Skip to content

Instantly share code, notes, and snippets.

@steamonimo
Last active April 28, 2021 18:30
Show Gist options
  • Save steamonimo/d3edf15c149da423a0727fabd8531ade to your computer and use it in GitHub Desktop.
Save steamonimo/d3edf15c149da423a0727fabd8531ade to your computer and use it in GitHub Desktop.
Windows commands

Windows: powershell commands

WMI query (Powershell)

Get-CimInstance -Class Win32_SystemEnclosure | Format-Table -AutoSize

or Get-WmiObject -query "Select * from Win32_SystemEnclosure"

Delete previous Windows updates (you can not revert back)

Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

Activate Windows Server as Edition ServerDataCenter with key X

dism /online /Set-Edition:ServerDataCenter /ProductKey:X /AcceptEula

Set execution policy for powershell scripts (Powershell)

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser

Get checksum of file (Powershell)

Get-FileHash a.exe -Algorithm SHA256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment