Last active
August 29, 2015 14:07
-
-
Save BenNeise/9cc7c75d1937de12f6a2 to your computer and use it in GitHub Desktop.
Revisions
-
BenNeise revised this gist
Oct 6, 2014 . 1 changed file with 40 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ # 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. ## 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 ```PowerShell Test-Ping -Computer "SERVER01" ``` Pings SERVER01 -
BenNeise created this gist
Oct 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ # 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