powershell
history
See command history in vscode
powershellcode (Get-PSReadLineOption | select -ExpandProperty HistorySavePath)
install / update
Install / update
powershelliex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
run multiple commands from a single shortcut
Set the target to the following:
plaintextC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Noexit -Command "C:\path\to\first\script.ps1 -SomeParam; & C:\path\to\second\script.ps1 -Another -Param 3001"
ping with timestamp to file
With 1sec response timeout:
powershellping.exe -w 1000 -t 8.8.8.8|Foreach{"{0} - {1}" -f (Get-Date),$_} > c:\my-file.txt
port listeners
powershellGet-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess
azure ad powershell deprecation
Azure AD Powershell is deprecated in favor of Microsoft Graph Powershell.