Skip to content

Latest commit

 

History

History
148 lines (90 loc) · 6.15 KB

Tips.PowerShell.md

File metadata and controls

148 lines (90 loc) · 6.15 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

PowerShell for the SQL DBA

Running PowerShell Scripts:

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