List of commands: https://www.pdq.com/powershell/. PowerShell, Powercat & Nishang
Common Commands + Alias + Table
<aside> 💡 Google for cmdlet or function Eg: Get-Command > goto #notes for summary and alias.
</aside>
Some commands that you might require on daily basis as a beginner for Pentesting.
Help menu -
Get-Help <Command>orhelp <command>orman <command>(PS treatsmansame ashelp) e.g.help New-Object, (Look REMARKS for more commands) -
Grep -
Select-Stringorslse.g. To find short alias of commands, alias ofGet-Aliasisgal:gal > shorts.txtthencat shorts.txt | sls "gal"outputsGet-Alias.
Calculate no of lines from a file: Length() method to retrive no of lines
(gc D:\\Temp\\commands.csv).Length (gc is Get-Content, other alias are cat & type)
List all commands: E.g. listing only cmdlets - gcm -CommandType Cmdlet (gcm is Get-Command) and (gcm -CommandType Cmdlet).Length outputs 6638 : no of cmdlets in PS.
Current Working Location: pwd or gl or Get-Location.
Test if Path esists: Test-Path "C:\\Users\\Administrator\\Documents\\Passwords"
Alternate for other OSes - shasum(mac), md5(mac), sha256sum(linux), md5sum(linux)
Get-FileHash D:\\Temp\\file.txt -Algorithm MD5 E.g. and Get-FileHash help menu.

