windows

history

See command history in vscode

powershell
code (Get-PSReadLineOption | select -ExpandProperty HistorySavePath)

kill process

powershell
Stop-Process -Id <processId>

ping with timestamp to file

With 1sec response timeout:

powershell
ping.exe -w 1000 -t 8.8.8.8|Foreach{"{0} - {1}" -f (Get-Date),$_} > c:\my-file.txt

port listeners

powershell
Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess