This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ip = "..." | |
| Add-Type -AssemblyName System.Windows.Forms | |
| $ping = New-Object System.Net.NetworkInformation.Ping | |
| while ($true) { | |
| $failures = 0 | |
| for ($i = 0; $i -lt 15; $i++) { | |
| try { | |
| $result = $ping.Send($ip, 3000) # 3 second timeout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Put into $PROFILE, trigger with Ctrl+h | |
| Set-PSReadLineKeyHandler -Chord Ctrl+h -ScriptBlock { | |
| $history = Get-Content (Get-PSReadLineOption).HistorySavePath | |
| [array]::Reverse($history) | |
| $selected = $history | Out-GridView -PassThru | |
| if ($selected) { | |
| [Microsoft.PowerShell.PSConsoleReadLine]::Insert($selected) | |
| } | |
| } |
OlderNewer