Tag Info

New answers tagged


try...catch work well in PowerShell, check out http://blogs.msdn.com/b/kebab/archive/2013/06/09/an-introduction-to-error-handling-in-powershell.aspx which has a great write up for try catch finally, and other items around error handling. for example (from link) try { <# Add dangerous code here that might produce exceptions. Place as ...


Get-SPWeb http://sharepoint -ErrorAction SilentlyContinue This will get the SPWeb object and continue whether or not it finds anything.

Top 50 recent answers are included