As PowerShell become more and more important tool in our day to day administration I have put up most of the basic commands that are being used by administrators and engineers.
Part 1 will give cover the basic commands and what they are doing.
Part 1
Terms
Cmdlets – command built into PowerShell
Get command – this command show us information about an item
Set command – this is the modifying command
; – semicolon commands
>> – append to existing file
Alias – create shortcut to a command
Basic Commands
Cd – open dir
Dir – show working directory
Md – make \ create a directory
Pwd – show path
Rmdir – remove directory
Mkdir – create directory
Display command
Format-table
Format-list
Format-wide
Get – command
Get-process – show running process
Get-process processname – check specific process name
Get-process name* – will search for a process start with the name
Stop-process -id number – stop a process
Whatif – tell you what heppan before you run a cmdlet
Sample – Stop-process -id number – whatif – stop a process
-confirm – ask for conformation before executing a command
Get-help – help command
Get-eventlog – show event log
Samples and Commands
Ipconfig \all > ipconfig.txt – Pipe result to text file
Notepad ipconfig.text – Launch file to screen
Piping a few commands
ipconfig /all > test.txt ; route print >> test.txt
Help Commands
Get-help get-help – help command
Get-help get* – will show all the get commands
Get-help set* – will show all the set commands
Get-help * – show all commands
Get-help get-psdrive –example – show you the syntax
Get-commands – display all the get commands
Alias
Get-alias – show all alias in use
Set-alias – create an alias
Get-alias |sort – sort all alias names
Set Alias
Set-alias gh get-help – set gh as an alias to get-help