QPingTest.ps1 (794B)
1 [CmdletBinding()] 2 param( 3 [Parameter(Mandatory=$true, 4 ValueFromPipeline=$true, 5 ValueFromPipelineByPropertyName=$true)] 6 [Alias ('HostName','cn','Host','Computer')] 7 [String]$ComputerName='localhost', 8 [int] $Timeout = 10000 9 ) 10 11 foreach($c in $ComputerName) { 12 13 Try { 14 if(Test-Connection -Cn $c -BufferSize 16 -Count 1 -ea 0 -quiet) 15 { 16 Write-Host “Epic Gamer Elite Hacking Squad connected successfully to $c” -ForegroundColor Green 17 } 18 else { 19 Write-Host “Epic Gamer Elite Hacking Squad could not connect to $c” -ForegroundColor Red 20 } 21 } 22 Catch { 23 Write-Host "Epic Gamer Elite Hacking Squad had an EPIC error!" -ForegroundColor Red 24 } 25 26 }