Problem
You want to automate the deployment or configuration of management packs.
Solution
To retrieve information about installed management packs, use the GetManagementPack cmdlet, as shown in Example 261.
Example 261. Using the GetManagementPack cmdlet
PS Monitoring:\Oxford.contoso.com >$mp = GetManagementPack | WhereObject { $_.DisplayName eq "Health Internal Library" } PS Monitoring:\Oxford.contoso.com >$mp
Name : System.Health.Internal TimeCreated : 5/22/2007 9:38:40 AM LastModified : 5/22/2007 9:38:40 AM KeyToken : 31bf3856ad364e35 Version : 6.0.5000.0 Id : 9395a1eb63221c8b71ad7ab6955c7e11 VersionId : dfaeece9437e7d46edce260bd77a8667 References : {System.Library, System.Health.Library} Sealed : True
Example 261. Using the GetManagementPack cmdlet (continued)
ContentReadable
: False
FriendlyName
: System Health Internal Library
DisplayName
: Health Internal Library
Description
: System Health Interal Library: This Management Pack (...)
DefaultLanguageCode : ENU LockObject : System.Object
Use the UninstallManagementPack cmdlet to remove a management pack:
$mp = GetManagementPack | WhereObject { $_.DisplayName eq "Management Pack Name" } $mp | UninstallManagementPack
To install a management pack, provide its path to the InstallManagementPack cmdlet:
InstallManagementPack <PathToManagementPack>
Discussion
For more information about the GetManagementPack cmdlet, type GetHelp GetManagementPack. For more information about the InstallManagementPack cmdlet, type GetHelp InstallManagementPack. For more information about the UninstallManagementPack cmdlet, type GetHelp UninstallManagementPack.