Share via


Test-SCManagementPack

Tests the validity of a management pack.

Syntax

Default (Default)

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

Description

The Test-SCManagementPack 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-SCManagementPack "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 (.).

Parameter properties

Type:

System.String[]

Default value:Localhost
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:System.Management.Automation.PSCredential
Default value:Current user context
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FullName

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

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments: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-SCManagementGroupConnection cmdlet.

Parameter properties

Type:

Microsoft.SystemCenter.Core.Connection.Connection[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.String

You can send a management pack full name to the FullName parameter of the Test-SCManagementPack 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.