Test-SCSMManagementPack

Tests the validity of a management pack.

Syntax

Test-SCSMManagementPack
    [-FullName] <String>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

Description

The Test-SCSMManagementPack cmdlet tests the validity of a management pack. This cmdlet replaces the MPVerify.exe utility, which verifies a management pack by using the software development kit (SDK) method ManagementPack.Verify(). This cmdlet requires that the user specify the path to the management pack file and the name of the computer to use for resolving dependencies. For management pack bundle files (.mpb), all the management packs in the bundle will be tested for validity.

All issues that are found during the test are written as nonterminating errors, one error per issue. The output of the cmdlet is an object consisting of the management pack name, the path of the management pack, and a property named Verified, which equals True if no errors are found and False if errors were found.

Examples

Example 1: Test a management pack

PS C:\>$MpError = Test-SCSMManagementPack "C:\temp\TestingMP.xml"
PS C:\>$MpError | Format-List
Verified : False

Name     : 

FullName : C:\temp\TestingMP.xml

Error    : XSD verification failed for the management pack. [Line: 29, Position: 8]

These commands test the TestingMP.xml management pack.

Parameters

-ComputerName

Specifies a computer with which to establish a connection. The computer must be running the System Center Data Access service. The default value is the computer for the current management group connection.

Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name (FQDN). To specify the local computer, type the computer name, "localhost", or a dot (.).

Type:System.String[]
Position:Named
Default value:Localhost
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Specifies a user account under which the management group connection will run. The account must have access to the server that is specified in the ComputerName parameter, if the server is specified. The default value is the current user.

You can enter a PSCredential object that is returned by the Get-Credential cmdlet.

Type:System.Management.Automation.PSCredential
Position:Named
Default value:Current user context
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FullName

Specifies the full name and path of the management pack. The management pack can be a sealed, unsealed, or bundled management pack.

Type:System.String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SCSession

Specifies a connection to a management server. The default value is the current management group connection.

You can enter a management group connection object that is returned by the Get-SCSMManagementGroupConnection cmdlet.

Type:Microsoft.SystemCenter.Core.Connection.Connection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

You can send a management pack full name to the FullName parameter of the Test-SCSMManagementPack cmdlet by using the pipeline operator. The FullName parameter accepts propertyname values, which are the output of Get-ChildItem and of any other commands that produce System.IO.FileInfo objects.

Outputs

Microsoft.SystemCenter.Core.Commands.ManagementPackVerificationResult

An object that represents a management pack verification result.