How to Uninstall a Program with PowerShell (4 Methods)

Uninstall a program with PowerShell

To uninstall a program with PowerShell, the simplest way on Windows 10 and 11 is winget. Find the program’s ID, then uninstall it silently: Below I show three more methods: Uninstall-Package, msiexec with the product code, and the program’s own uninstall string. For safety, my examples find and preview the uninstall without removing anything. Find … Read more

How to Enable Remote Desktop Using PowerShell (Local and Remote)

Enable Remote Desktop using PowerShell

To enable Remote Desktop using PowerShell, set fDenyTSConnections to 0 in the registry and turn on the Remote Desktop firewall rules. Run both lines as administrator: Below I check the current state first, then cover NLA, allowing users, enabling RDP on remote PCs and turning it off again. The checks ran on Windows 11 in … Read more

How to List All Environment Variables in PowerShell

List all environment variables in PowerShell

To list all environment variables in PowerShell, run Get-ChildItem on the Env: drive. Sorting by name makes the list easy to scan: Below I show how to read the output, pick out single variables, filter with wildcards, compare the Process, User and Machine scopes, and split PATH into readable lines. I tested it all in … Read more

How to Check if a Port Is Open Using PowerShell (Fast Methods)

Check if a port is open using PowerShell

To check if a port is open using PowerShell, run Test-NetConnection with the host name and port. -InformationLevel Quiet returns just True or False: Output: That’s perfect for one check, but it can take 20 seconds or more when the port is closed. Below I show a faster check with a timeout, a reusable function, … Read more

How to Check for Windows Updates Using PowerShell

Check for Windows updates using PowerShell

To check for Windows updates using PowerShell, ask the built-in Windows Update Agent to search. It needs no extra module and no admin rights: Below I list what’s waiting with KB numbers, show when Windows last checked, find where updates come from and check other PCs. I ran each check in PowerShell 7.6 and Windows … Read more

Fix: The File Is Not Digitally Signed. You Cannot Run This Script

Fix the file is not digitally signed error in PowerShell

The “file is not digitally signed. You cannot run this script on the current system” error means your execution policy only runs signed scripts, and this one isn’t signed. For a script you trust, the quickest fix is to unblock it: Below I reproduce the error, show why it happens, and walk through four fixes … Read more

How to Install .NET Framework 3.5 Using PowerShell (Online and Offline)

Install .NET Framework 3.5 using PowerShell

To install .NET Framework 3.5 using PowerShell, enable the NetFx3 Windows feature in an elevated window. Windows downloads the files from Windows Update: That works on Windows 11 25H2 and earlier, Windows 10 and Windows Server. Windows 11 26H1 and later need a separate installer instead. Below I cover checking, installing online and offline, and … Read more

How to Install Snipping Tool in Windows 11 Using PowerShell

Install Snipping Tool in Windows 11 using PowerShell

To install Snipping Tool in Windows 11 using PowerShell, install it from the Microsoft Store with winget. Snipping Tool’s Store ID is 9MZ95KL8MR0L: Windows 11 already includes Snipping Tool, so check first. Below I show how to find it, re-register it when it’s broken, reset it and reinstall it, tested in PowerShell 7.6 and Windows … Read more

PowerShell Invoke-WebRequest: GET, POST, Download and Error Examples

PowerShell Invoke-WebRequest examples

PowerShell Invoke-WebRequest sends an HTTP or HTTPS request and returns the full response: status code, headers, content and links. The simplest call is a GET request to a URL: Below I cover GET and POST requests, custom headers, downloading files, calling a REST API and handling errors. I tested these against real sites in PowerShell … Read more