get-service -
windows workflow foundation
require .net framework + wmf
w2008 v1.0 ... v3.0
v4.0 supported OS
- w7
workflows can survive reboot
dsc desired state configuration
- can log deviations
- can autocorrect
AltenateNames - aliases
- built in aliases
- user defined aliases
external commands run as separate process
- cannot discover the syntax
cmdlets
- native ps commands
- does not launch in separate process
- single purpose
- verb-noun naming
- noun in singular
- now Verb-PrefixNoun
eg. prefix VM, AD
show-command is the gui version of get-command
get-help is the detailed version and includes examples
eg..
get-help get-service -examples
get-help get-service -showwindow ... gui version
general help on concept
get-help about_*
tabs in the help = parameter sets
-outvariable <variablenamewithout$> captures cmdlet output into
variable
or
$var = cmdlet
common parameters
ErrorAction
ErrorVariable
OutVariable
etc
command termination
; or newline
get-content filename to read from file
get-process | get-member
will show the properties and methods of process
how to get top 10 process by virtual memory usage
get-process | sort-object -property VM | select-object -first 10 `
-Property ProcessName,VirtualMemorySize
' for literal i.e. no variable expansion of $var
" for i.e. expands $var
remoting
(1) DCOM-RPC (legacy, port 135 & then random) e.g. cmdlets that use ComputerName parameter
(2) WS-MAN (port 5985 http, 5986 https) e.g. invoke-command & enter-pssesssion
powershell.exe or ise.exe on the source host
wsmprovhost.exe is the process on the remote machine