The many ways to import the ConfigMgr cmdlet Library module

Over the years I’ve seen and used a variety of PowerShell commands to get the ConfigurationManager.psd1  file location to pass to Import-Module

Just for fun, I compiled a list of the different methods.  It’s all about string manipulation.

When using a ConfigMgr cmdlet it is necessary to work from the ConfigMgr site’s drive.  I’ve also seen a variety of ways to accomplish this as detailed below.

When more than one ConfigMgr site is registered on a computer, it may be necessary to more specifically identify it.  This is one example.

Lastly, note the difference between the *-Location  cmdlets.  Using Push/Pop-Location allows changing to the ConfigMgr site drive before running the cmdlets then returning to the previous location afterward.

Push-Location and the alias pushd.

Pop-Location  and the alias popd.

Set-Location  and the aliases cd , chdir , and  sl.

One Response

  1. Trevor March 17, 2017

Leave a Reply to Trevor Cancel reply


We use cookies to ensure the best possible experience on our website. Detailed information on the use of cookies on this site is provided in our Privacy and Cookie Policy. Further instruction on how to disable our cookies can be found there.