How to Get Windows Activation Status Using PowerShell

Get Windows activation status using PowerShell

To get the Windows activation status with PowerShell, query the SoftwareLicensingProduct class for Windows and read LicenseStatus. A value of 1 means Windows is activated: It works without admin rights in PowerShell 7 and 5.1. Below I turn the number into readable text, build a quick yes-or-no check, query remote PCs and compare it with … Read more

How to Get Windows Event Logs Using PowerShell

Get Windows event logs using PowerShell

To get Windows event logs using PowerShell, run Get-WinEvent with the log name. This returns the 20 newest events from the System log: For anything bigger, filter with -FilterHashtable so Windows does the filtering before PowerShell sees the events. Below I cover listing logs, filtering by ID, level and date, the Security log, exporting and … Read more

How to Set a Proxy in PowerShell (7 and 5.1)

Set a proxy in PowerShell

To set a proxy in PowerShell for one request, pass it to -Proxy on Invoke-WebRequest or Invoke-RestMethod. Add -ProxyUseDefaultCredentials if the proxy needs your Windows sign-in: For a whole session, the method differs between PowerShell 7 and Windows PowerShell 5.1. I cover both below, plus bypass lists and the Windows-wide proxy. The proxy server in … Read more

Can You Uninstall Microsoft Edge Using PowerShell? (What Works)

Uninstall Microsoft Edge using PowerShell

You can only uninstall Microsoft Edge using PowerShell or Settings if your PC was set up in the European Economic Area (EEA). In the US and everywhere else, Windows treats Edge as part of the operating system and blocks its uninstaller. Below I show how to check what’s installed and why removal is blocked, the … 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 Create a Self-Signed Certificate Using PowerShell

Create a self-signed certificate using PowerShell

To create a self-signed certificate using PowerShell, run New-SelfSignedCertificate with the DNS names and the certificate store to save it in. The current-user store doesn’t need admin rights: Below I show what a self-signed certificate contains, how to export it as .cer and .pfx files, and how to trust it for testing. To keep my … Read more

How to Create Desktop Shortcuts with Custom Icons Using PowerShell

Create desktop shortcuts with custom icons using PowerShell

To create a desktop shortcut with a custom icon in PowerShell, use the WScript.Shell COM object. CreateShortcut makes a .lnk file, and you set its TargetPath, IconLocation and other properties before calling Save(): Output: I created every shortcut in a test folder so the output is easy to check. The last section shows how to … Read more

How to Rename a Windows Computer Using PowerShell

Rename a Windows computer using PowerShell

To rename a Windows computer with PowerShell, open PowerShell as an administrator and run Rename-Computer -NewName with the new name. Add -Restart, because the new name only takes effect after a restart: It works the same in PowerShell 7 and Windows PowerShell 5.1. I didn’t rename my own PC for this article. Every example below … 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

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