Skip to content

Latest commit

 

History

History
179 lines (116 loc) · 7.06 KB

File metadata and controls

179 lines (116 loc) · 7.06 KB

Userful PowerShell Resources

Documentation

PowerShell Gallery

PowerShell Learning/Tutorial/Example Resources

Community Resources

Suggest Books

Useful Commands:

  • What Version am I running?

    • $PSVersionTable.PSVersion
  • Add a firewall rule

    • netsh advfirewall firewall add rule name="docker engine" dir=in action=allow protocol=TCP localport=2375
  • Generate a GID

    • [guid]::newguid()
  • Get Hash

  • Get Serial Numbers:

    • wmic memorychip get serialnumber
    • wmic diskdrive get serialnumber
    • wmic baseboard get serialnumber
    • wmic cdrom where drive='d:' get SerialNumber
  • Disable WiFi

    • netsh interface set interface name="Wireless Network Connection" admin=DISABLED
  • Hybernation

    • powercfg /hibernate on
    • powercfg /hibernate off
  • Explore a command...

    • <command> | Get-Member
    • Will return:
      • Properties
      • Methods
      • AliasProperty
      • Event
      • ScriptMethod
      • ...
    • Examples:
      • get-localuser | Get-Member
    • Also see:
      • Get-Command
      • Get-Help
      • Get-Member

PowerShell for the SQL DBA

Running PowerShell Scripts:

Running PowerShell Scripts from command-line, or windows batch files