Last active
November 14, 2017 04:09
-
-
Save techthoughts2/3c0b0401b55d73cbbe34 to your computer and use it in GitHub Desktop.
Test if specified path actually exists
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 characters
$path = "C:\Windows" | |
try { | |
if (Test-Path $path -ErrorAction Stop) { | |
Write-Output "Path exits" | |
} | |
else { | |
Write-Output "Path not found" | |
} | |
} | |
catch { | |
Write-Error $_ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment