Skip to content

Instantly share code, notes, and snippets.

@BenNeise
Last active August 29, 2015 14:07
Show Gist options
  • Save BenNeise/9cc7c75d1937de12f6a2 to your computer and use it in GitHub Desktop.
Save BenNeise/9cc7c75d1937de12f6a2 to your computer and use it in GitHub Desktop.
Test-Ping sample documentation
# Test-Ping
## Synposis
Pings a server and returns TRUE or FALSE.
## Syntax
```PowerShell
\Test-Ping.ps1 [-computer] <String> [<CommonParameters>]
```
## Description
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.
## Paramaters
### computer
- **Type**: String
- **DefaultValue**: $(Throw "Computer or IP is mandatory, please provide a value.")
- **ParameterValue**: String
- **PipelineInput**: false
- **Position**: 2
- **Required**: true
## Examples
### Example 1
```PowerShell
Test-Ping -Computer "SERVER01"
```
Pings SERVER01

Test-Ping

Synposis

Pings a server and returns TRUE or FALSE.

Syntax

\Test-Ping.ps1 [-computer] <String> [<CommonParameters>]

Description

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.

Parameters

computer

  • Type: String
  • DefaultValue: $(Throw "Computer or IP is mandatory, please provide a value.")
  • ParameterValue: String
  • PipelineInput: false
  • Position: 2
  • Required: true

Examples

Example 1

Test-Ping -Computer "SERVER01"

Pings SERVER01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment