Jump to content
Software FX Community

Checking for powergadgets snap-in


marco.shaw

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...