Created
August 30, 2019 12:32
-
-
Save kpatnayakuni/1edc00b2597faae0fa45bf8ef9d31373 to your computer and use it in GitHub Desktop.
This file contains 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 characters
PS C:\Users\kiran> Try { Test-Connection "localhost" -Count 1 } Catch { Write-Host "Connection Error" } Finally { Write-Host "`nTest Complete" } | |
Source Destination IPV4Address IPV6Address Bytes Time(ms) | |
------ ----------- ----------- ----------- ----- -------- | |
Workstation localhost 127.0.0.1 ::1 32 0 | |
Test Complete | |
PS C:\Users\kiran> Try { Test-Connection "localhost1" -Count 1 } Catch { Write-Host "Connection Error" } Finally { Write-Host "`nTest Complete" } | |
Test-Connection : Testing connection to computer 'localhost1' failed: No such host is known | |
At line:1 char:7 | |
+ Try { Test-Connection "localhost1" -Count 1 } Catch { Write-Host "Con ... | |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ CategoryInfo : ResourceUnavailable: (localhost1:String) [Test-Connection], PingException | |
+ FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand | |
Test Complete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment