Pings a server and returns TRUE or FALSE.
\Test-Ping.ps1 [-computer] <String> [<CommonParameters>]
Uses WMI to ping a server, and returns TRUE if a status code of 0 is returned, otherwise returns FALSE. Useful for quick checks to see if a server exists and is online.
- Type: String
- DefaultValue: $(Throw "Computer or IP is mandatory, please provide a value.")
- ParameterValue: String
- PipelineInput: false
- Position: 2
- Required: true
Test-Ping -Computer "SERVER01"
Pings SERVER01