Skip to content

Instantly share code, notes, and snippets.

@alimbada
Last active November 28, 2025 18:41
Show Gist options
  • Select an option

  • Save alimbada/7f1608d4e51c0a3770f121d9778307d7 to your computer and use it in GitHub Desktop.

Select an option

Save alimbada/7f1608d4e51c0a3770f121d9778307d7 to your computer and use it in GitHub Desktop.
Powershell Cheat Sheet

Windows/Powershell Cheat Sheet

Get Windows Product Key

(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform").BackupProductKeyDefault

Remove disconnected devices

Get-PnpDevice | where { $_.Status -eq "Unknown" } | % { pnputil /remove-device $_.InstanceId }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment