21 Jan 2013 @ 8:39 AM 

Earlier this month I posted a Powershell function to check for a loaded module.
Bas Steeloper, another Dutch IT Pro, commented on the post and by tweaking the function I’ve provided in the post he came up with a another function to check for a loaded snapin.

You can find his comment here but for your convenience here is the code:

function Check-LoadedSnapIN{
  Param( [parameter(Mandatory = $true)][alias("SnapIN")][string]$SnapINName)
  if ( (Get-PSSnapin -Name $SnapINName -ErrorAction SilentlyContinue) -eq $null )
  {
    Add-PsSnapin $SnapINName
  }
}

Post to Twitter

Posted By: Jeff Wouters
Last Edit: 25 Jan 2013 @ 05:14 AM

EmailPermalink
Tags
Categories: DuPSUG, PowerShell



 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 248
  • Comments » 429
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

Contact



    No Child Pages.