PwshTips / field notes for admins

PowerShell for real administration

Practical scripts, troubleshooting notes, and repeatable workflows for Windows, PowerShell, WSL, Linux, and automation.

Start with a focused guide, copy a tested command, and adapt it to your environment.

PwshTips PowerShell and Windows administration

Clear commands. Real constraints. Fewer surprises.

Enable Remote Access to a Non-Domain Windows Computer

Setting up a fresh Windows workstation or recovering an isolated standalone server often leaves you in a difficult spot: you have zero physical or console access to the computer. You cannot plug in a keyboard, there is no crash cart monitor attached, and no remote KVM/iLO/iDRAC console is available. All you have is the machine’s static IP address on the network and the local administrator account credentials. Yet when you attempt standard troubleshooting, Test-Connection fails with packet timeouts, Remote Desktop reports error code 0x204, and Enter-PSSession throws a WinRM connection refused error. ...

September 22, 2026 · 12 min · PwshTips

Fix git bad object HEAD on Windows

Running git status in a repository that was working perfectly fine yesterday and getting hit with this: fatal: bad object HEAD fatal: 'git status --porcelain=2' failed in submodule web/hugo/hugoweb/h2 The error appears as two fatal lines: the first on the main repository and the second propagating into a submodule. This is one of those errors that feels worse than it is. The repository is not gone. The commits are almost certainly intact. What has failed is Git’s ability to resolve the name HEAD to a valid commit object, which breaks nearly every Git command that needs to know what the current state of the repository is. ...

September 22, 2026 · 12 min · PwshTips

How to Build a Local Git Server on Ubuntu

While public cloud platforms like GitHub and GitLab are ubiquitous, many enterprise environments, air-gapped networks, and privacy-conscious organizations require keeping their source code and automation scripts entirely on-premises. Storing internal credentials, proprietary PowerShell modules, and infrastructure configurations within your local LAN ensures compliance, eliminates third-party cloud outages, and gives administrators complete sovereignty over their data. However, setting up a bare Git server with plain SSH shared folders lacks the collaborative features teams expect: interactive code browsing, visual diff comparisons, issue tracking, organization teams, branch protection, and Pull Request reviews. ...

September 22, 2026 · 10 min · PwshTips

How to Create and Manage a Team on GitHub

When an IT department transitions from individual administrators writing scripts on isolated workstations to a collaborative engineering team, managing access on a per-person basis quickly becomes unmaintainable. An administrator leaves the company, and their individual account must be manually unlinked from dozens of repositories; a new engineer joins, and someone spends hours granting them access one repository at a time. GitHub solves this organizational sprawl through GitHub Organizations and Teams. Teams allow leads to implement role-based access control (RBAC), enforce security boundaries, automate code reviews, and maintain a clear audit trail across shared infrastructure code, PowerShell modules, and deployment templates. ...

September 22, 2026 · 12 min · PwshTips

How to Install Git on Windows and Linux (WSL)

Setting up a robust developer or systems administration workstation often requires working across both native Windows (PowerShell) and a Linux subsystem (WSL). Because version control coordinates configurations, automation scripts, and application source code, having Git installed and configured correctly in both environments is a fundamental prerequisite. Without deliberate setup, administrators frequently encounter annoying friction: entering GitHub or GitLab personal access tokens repeatedly inside WSL, running into permission errors on cross-mounted drives (/mnt/c/), or corrupting shell scripts because Windows inserted carriage return (CRLF) line endings into bash scripts. ...

September 22, 2026 · 10 min · PwshTips

How to Use GitHub for System Administrators

For many system administrators, version control began as a folder full of scripts named backup-script-v1.ps1, backup-script-v2-final.ps1, and backup-script-v2-final-REALLYFINAL.ps1. Moving to Git solved local versioning, but modern IT operations require central collaboration, peer review, backup, and automated deployment. This is where GitHub becomes indispensable. GitHub transforms isolated scripts on administrator laptops into structured, collaborative infrastructure. Whether you manage PowerShell modules, Terraform definitions, Docker containers, or static documentation sites, understanding how GitHub works—and how to interact with it securely—is essential. ...

September 22, 2026 · 13 min · PwshTips

Fix Discord Error Code 4294967295

When installing or updating Discord through Windows Package Manager (winget), the installation can suddenly abort right after the installer package downloads and verifies. Instead of launching the app, winget reports a failure with exit code 4294967295, and a setup dialog displays “Installation has failed”. This error is common during unattended deployments, scripted workstation setups, or manual package upgrades where an older copy of Discord was already running or partially installed. ...

August 23, 2026 · 8 min · PwshTips

Manage Active Directory Without Logging On to a Domain Controller

Routine Active Directory work does not require an RDP session or an interactive console sign-in on a domain controller. A separate, managed administration workstation is a better place to run the AD tools, inspect objects, make a narrow change, and keep a record of who performed it. That separation matters. Domain controllers hold directory credentials, Kerberos keys, DNS data, and the tools that change the forest. Browsing the web, opening email, or running a general-purpose admin desktop workflow on a DC increases the chance that a workstation-style problem becomes a directory-wide incident. ...

August 16, 2026 · 10 min · PwshTips

Run Go Programs from PowerShell

Go and PowerShell work well together on Windows. PowerShell is convenient for orchestration, object filtering, scheduled tasks, and Windows management APIs. Go is useful when a small tool needs a single compiled executable, predictable startup behavior, or easy distribution to machines that do not have a PowerShell module installed. The useful split is simple: use PowerShell to prepare inputs, call the Go program, inspect its output, and react to its exit code. Let the Go program own the focused task it was written for. Do not make PowerShell scrape a human-oriented console screen when the Go command can return structured JSON or a clear exit code instead. ...

August 16, 2026 · 9 min · PwshTips

Run PowerShell Scripts from Go

Go is a good place to coordinate a Windows utility that needs a compiled executable, HTTP service, queue worker, or structured application logic. PowerShell is still useful for the Windows task itself: calling a mature module, querying local configuration, or using an administrative command that already exists as a script. The reliable boundary is a PowerShell script file with named parameters, predictable standard output, useful standard error, and an explicit exit code. Let Go launch that file as a process. Do not build one large PowerShell command string from user input and hand it to -Command; nested quoting becomes fragile and command injection becomes easy to introduce. ...

August 16, 2026 · 11 min · PwshTips