I'm trying this to catch an exception but it just doesn't work rather just shows me error in the script editor I'm running the script from:-
Path I mentioned in the script "\server\abc" doesn't really exist, so it should catch it as an exception which it is not. HELP HELP
Try
{
Get-ChildItem -Path "\\server\abc"
}
Catch
{
Write-Host "error"
}