A quick post, serving as a kickstarter for my blogging activities, here (almost) post the covid-19 situation.
Today’s topic is probably not something new for a lot of the amazing IT-pros, who’s already familiar with PowerShell ISE and the Configuration Manager PowerShell module.
Nonetheless, I figured this would be a great way to kickstart my blogging activities, while someone else hopefully will learn something new along the way.
ConfigMgr PowerShell module
The Configuration Manager PowerShell module comes with the installation of the admin console, and is located here: C:\Program Files (x86)\Microsoft Endpoint Manager\AdminConsole\bin\ConfigurationManager.psd1
- NOTE: The path may vary depending on the version of Configuration Manager and when the admin console was installed. For older installations, the module can be located in C:\Program Files (x86)\Microsoft Configuration Manager.
To make life a tad easier, the admin console provides a native way of importing and connecting to the module. This is found via the drop down and using ‘Connect via Windows PowerShell ISE‘.
- This will pop up a script generated into AppData\Local\Temp called ISEConnect_SiteCode – SiteName.ps1
- Make that into a function, like below, and save that into your Documents folder in sub-folder called WindowsPowershell. Save this script as Microsoft.PowerShellISE_profile.ps1
- Or better yet, grab my example from my GitHub here: Powershell/Connect-ConfigMgr-ISEAddons.ps1 at master · imabdk/Powershell (github.com)
- The sub-folder mentioned above, is the one highlighted below. Create this manually if it does not exists already:
You now have the option to connect to your Configuration Manager hierarchy directly from within PowerShell ISE.
When running Get-Command -Module ConfigurationManager, you will get a list of all the available cmdlets: