techthoughts2
12/28/2015 - 3:37 PM

Verify Path

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 $_
}