Retrieving Management Pack Reference Aliases using PowerShell

Today I was playing around with some MP Authoring automation using PowerShell and I needed to retrieve the Management Pack Reference Alias within a Management Pack. If you export a Management Pack to XML using the Get-SCOMManagementPack Cmdlet you can view the XML file and its contents.

Get-SCOMManagementPack -Name Stefan.Test.MP | Export-SCOMManagementPack -Path c:\temp

If you look at the exported MP XML file you can see the Management Pack Reference Aliases.

<ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="" xmlns:xsl="">
    <Name>Stefan - Test MP</Name>
      <Reference Alias="MicrosoftWindowsLibrary7585010">
      <Reference Alias="SystemLibrary7585010">
      <Reference Alias="SystemCenter">
      <Reference Alias="Health">
      <Reference Alias="MicrosoftSystemCenterInstanceGroupLibrary7585010">

But you know me, I don’t want to export the XML file and open it to see the Reference Aliases Smile We have  PowerShell so we are going to use it.

How can we retrieve this info using PowerShell in the PowerShell OperationsManager Console?

$mp = Get-SCOMManagementPack -name Stefan.Test.MP

$alias = ($mp.References | where {$_.Value -like "*Microsoft.Windows.Library*"}).key


This will give us the Alias for the Microsoft.Windows.Library.


Next time more on how we could use this information to do some MP Authoring automation.


Have a nice Easter weekend and maybe I see you at MMS in Las Vegas or the PowerShell Summit in Redmond!

Comments (1)
  1. Anonymous says:

    That very useful code, thanks Stefan.

Comments are closed.

Skip to main content