Powershell notes

I’ve wanted to learn about powershell for a while, but never really had time to mess around with it.
This post will be a collection of key ideas and commands as I read through a book or two on powershell.

#1 Launch powershell:
powershell
#2 Launch powershell ise
powershell_ise
#3 get-childitem
in the powershell command window, hit F7 to bring up a list of recently used commands

commands to get info about commands:
get-Command – (info about command)
get-help *-* (gets info about all commands)
get-help get-* (gets help about all get commands)
get-help set-* (gets help about all set commands)get
invoke-command
measure-command (measure run time)
Trace-command (trace)

Get-hotfix (gets hotfix info)

display environment variables with $env:varname ie $env:computernameget
See the execution Policy: get-ExecutionPolicy
Set the execution policy so it will run anything: Set-ExecutionPolicy

pipeable formatting commands:
format-wide -column 3 (ie Get-command | format-wide -column 3)