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

Windows PowerShell vs CMD: Key Differences With Examples

Windows PowerShell vs CMD

Windows PowerShell vs CMD comes down to one difference: CMD passes plain text between commands, while PowerShell passes .NET objects you can filter, sort and format. For anything beyond a quick one-liner, PowerShell is the better choice. CMD (cmd.exe, the Command Prompt) is still around for batch files and old habits. Below I compare the … Read more

How to Install winget Using PowerShell (and Fix It When It’s Missing)

Install winget using PowerShell

To install winget using PowerShell, register the App Installer package that already ships with Windows. This one command fixes a missing winget on most Windows 11 and Windows 10 PCs: winget, the Windows Package Manager, is part of App Installer. Below I show how to check whether you already have it, the command that repairs … Read more

How to Unblock Files Recursively Using Unblock-File in PowerShell

Unblock files recursively in PowerShell

To unblock files recursively in PowerShell, list every file in the folder with Get-ChildItem -Recurse and pipe them to Unblock-File: Only do this for files you trust. Below I show how Windows marks downloads, how to find blocked files first, and how to unblock only scripts, all tested in PowerShell 7.6 and 5.1. Why Windows … Read more

How to Disable Windows Defender Using PowerShell (and Turn It Back On)

Disable Windows Defender using PowerShell

To disable Windows Defender real-time protection using PowerShell, run Set-MpPreference in an elevated window, after turning off Tamper Protection in Windows Security: Microsoft Defender Antivirus is the current name for Windows Defender. Turning it off leaves the PC unprotected, so do it only briefly while troubleshooting. Below I cover checking the status, why the command … Read more

How to Change Directory in PowerShell (cd and Set-Location)

Change directory in PowerShell

To change directory in PowerShell, use Set-Location, or its short alias cd, followed by the folder path. Get-Location shows where you are now: Output: Below I cover relative paths, folders with spaces, going back to the previous folder, and a .NET gotcha that trips up scripts. Every example ran in PowerShell 7.6 and Windows PowerShell … Read more

How to Install Git on Windows Using PowerShell

Install Git on Windows using PowerShell

To install Git on Windows using PowerShell, run one winget command. winget is the Windows Package Manager, built into Windows 11 and current Windows 10 releases: That’s the command the Git project itself recommends. -e matches the ID exactly, so winget can’t pick a similarly named package. Below I cover checking the install, updating, setting … Read more

PowerShell Test-NetConnection: Test Ports, Ping and Routes

PowerShell Test-NetConnection examples

Test-NetConnection checks whether your computer can reach another host, and whether a specific TCP port on it is open. Give it a computer name and a port: Output: TcpTestSucceeded True means the port accepted a connection. I selected three properties because the full output also lists your own IP address and network adapter. Every example … Read more