0

I'm running posh 4.0 on Windows Server 2012 R2.

When this line is reached and the $site variable contains a non existent site, the error is not trapped and instead the generic error is displayed.

try{$web = get-spweb $site}
catch{write-host "Unable to find $site. Check the url or Contact Farm Adminimstrator"; EXIT;}

I have never run into this situation where a try catch doesn't trap an error. It behaves as though the error ahndling is not on the page. Is there something I should be doing in posh 4 to activate this behavior?? Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.