Right but how do I insert it in my script. I tried the statement below and pressing q didn't do anything
while($true) { 2..250|ForEach { if (!((Test-Connection 192.168.127.$_ -count 1 -Quiet) -and (resolve-dnsname -ea 0 192.168.127.$_ ))) {write-Output "IP Address Available 192.168.127.$_ and no DNS entries"}} if($Host.UI.RawUI.KeyAvailable -and ("q" -eq $Host.UI.RawUI.ReadKey("IncludeKeyup,NoEcho").Character)) { Write-Host "Exiting now, don't try to stop me...." -BackgroundColor DarkRed break; } }
Right but how do I insert it in my script. I tried the statement below and pressing q didn't do anything