Quantcast
Channel: Microsoft Intune
Viewing all articles
Browse latest Browse all 1216

How to prevent non-terminating Powershell errors from showing as "Failed"?

$
0
0

Good day all,

I'm deploying a Powershell script via the "Powershell Scripts" system in Intune (found under the device settings).

It seems (and I still need to verify to be sure, but I'm fairly confident at this point) that even with non-terminating errors in the script, it will report back as Status "Failed". Which is pretty odd- can anyone verify this behavior for me?

And if so I'd like some advice- it's a fairly complex script manipulating a lot of different pieces, and some of those things will not work on certain devices (which is fine, the over all script still does what it needs to in those cases). Should I change my error action preferences to "Stop" and use a Try-Catch on those parts? But that also opens up other minor errors that I might not be aware of to cause the script to fail.

Any advice here is much appreciated. Thanks!


Viewing all articles
Browse latest Browse all 1216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>