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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...