Share via


Protect-SCManagementPack

Seals a management pack, preventing it from being modified.

Syntax

FromManagementPack

Protect-SCManagementPack
    [-ManagementPack] <ManagementPack[]>
    -OutputDirectory <String>
    -KeyFilePath <String>
    -CompanyName <String>
    [-Copyright <String>]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

FromManagementPackFile

Protect-SCManagementPack
    [-ManagementPackFile] <String[]>
    -OutputDirectory <String>
    -KeyFilePath <String>
    -CompanyName <String>
    [-Copyright <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Protect-SCManagementPack cmdlet seals a management pack to prevent modification. The sealed management pack is stored in the folder that is specified by the OutputDirectory parameter. The sealed management pack can be imported into smshort.

Examples

Example 1: Seal a management pack

PS C:\>$Mp = Get-SCManagementPack -ManagementPackFile "Resources\ContosoForm.xml"
PS C:\> $Arguments = @{
>> ManagementPack = $Mp
>> OutputDirectory = $PWD
>> KeyFilePath = "Resources\keyfile.snk"
>> CompanyName = "Contoso"
>> Copyright = "2011"}
PS C:\> Protect-SCManagementPack @Arguments

These commands seal the management pack ContosoForm.xml.

Parameters

-CompanyName

Specifies the company name for the signature of the sealed management pack.

Parameter properties

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

Parameter sets

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

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

Specifies the copyright string for the signature of the sealed management pack.

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-KeyFilePath

Specifies the path to the file that contains the key for the signature of the sealed management pack.

Parameter properties

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

Parameter sets

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

-ManagementPack

Specifies the management pack to seal. You can enter a ManagementPack object that is returned by the Get-SCManagementPack cmdlet.

Parameter properties

Type:

Microsoft.EnterpriseManagement.Configuration.ManagementPack[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromManagementPack
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ManagementPackFile

Specifies the name of the management pack file.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromManagementPackFile
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-OutputDirectory

Specifies the folder for the sealed management pack.

Parameter properties

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

Parameter sets

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

-PassThru

Specifies the output object that represents the sealed management pack. This output object can be passed to other cmdlets.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromManagementPack
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

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 pipe a management pack file name to the ManagementPackFIle parameter of the Protect-SCManagementPack cmdlet.

Microsoft.EnterpriseManagement.Configuration.ManagementPackManagement pack object.

You can pipe a management pack object to the ManagementPack parameter of the Protect-SCManagementPack cmdlet, for example, the object that is returned by the Get-SCManagementPack cmdlet.

Outputs

Management pack object.

This cmdlet generates a management pack object when it is used with the PassThru parameter.

Sealed management pack.

This cmdlet generates a sealed management pack that is stored in the folder that is specified by the OutputDirectory parameter.