Watch port availability
cls;while($true){get-date;$t = New-Object Net.Sockets.TcpClient;try {$t.connect("10.45.2.68",3389);write-host "RDP is up"}catch{write-Host "RDP is down"}finally{$t.close();sleep 30}}
Watch the event viewer
cls;$idxA = (get-eventlog -LogName Application -Newest 1).Index;while($true){$idxA2 = (Get-EventLog -LogName Application -newest 1).index;get-eventlog -logname Application -newest ($idxA2 - $idxA) | sort index;$idxA = $idxA2;sleep 10}
Watch the current status of specific EC2 instances Requires this script
while ($true){cls;.\status.instances.ps1 i-b2cd9bd5, i-3ba7545a, i-87a226e9;sleep 30}
Watch netstat Requires admin powershell
while($true){cls;netstat -bantp tcp;sleep 5}
Tail a log
Get-Content c:\log.txt -Wait