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} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.