Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Ping-Host {param ( [string ]$HostName,
- [int32] $Requests = 1)
- for ($i = 1; $i -le $Requests; $i ++) {
- $Result = Get-WmiObject -Class Win32_PingStatus -ComputerName . -Filter "Address=' $HostName'"
- Start-Sleep -Seconds 1
- if ($Result .StatusCode -ne 0) { return $FALSE }
- }
- return $TRUE
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement