Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active November 14, 2017 04:09
Show Gist options
  • Save techthoughts2/3c0b0401b55d73cbbe34 to your computer and use it in GitHub Desktop.
Save techthoughts2/3c0b0401b55d73cbbe34 to your computer and use it in GitHub Desktop.
Test if specified path actually exists
$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