Skip to content

Instantly share code, notes, and snippets.

@smac89
Last active April 30, 2024 07:26
Show Gist options
  • Save smac89/d08fda2c8e22fa1a4a4fba4847159d04 to your computer and use it in GitHub Desktop.
Save smac89/d08fda2c8e22fa1a4a4fba4847159d04 to your computer and use it in GitHub Desktop.
Windows administrative Commands (Powershell)
  1. To kill a service
  • Get-Service -Name <servicename> | Stop-Service [-Force]
  1. Reset windows update: Script
  2. Run a windows powershell script or command
  • powershell.exe -ExecutionPolicy ByPass -File <script.ps1>
  • powershell.exe -ExecutionPolicy ByPass -Command "iex ((New-Object System.Net.WebClient).Download String('https://chocolatey.org/install.ps1'))"
  1. Will add more as I need...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment