marco.shaw Posted December 4, 2006 Report Share Posted December 4, 2006 Just a quick code snippet to check whether the powergadgets snap-in is loaded on a system. One won't get any ugly errors, and the Powershell script will gracefully exit. $err=@() # Check for powergadgets snap-in. $return=get-pssnapin powergadgets -ea silentlycontinue -ev err # Check err array if powergadgets snap-in not found. If not found, exit. if($err.count -gt 0){write-output "Powergadgets.com snap-in does not appear to be loaded. Exiting...";break} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.