Set-CMPackage

Set-CMPackage

Changes configuration settings for Configuration Manager packages.

Syntax

Parameter Set: SetById
Set-CMPackage -Id <String[]> [-Description <String> ] [-DistributionPriority <Priorities> {High | Low | Normal} ] [-ForcedDisconnectDelay <Int32> ] [-ForcedDisconnectEnabled <Boolean> ] [-ForcedDisconnectNumberRetries <Int32> ] [-Language <String> ] [-Manufacturer <String> ] [-MifFileName <String> ] [-MifName <String> ] [-MifPublisher <String> ] [-MifVersion <String> ] [-NewName <String> ] [-Path <String> ] [-SecuredScopeNames <String> ] [-ShareName <String> ] [-ShareType <ShareTypes> {ShareCommon | ShareSpecific} ] [-Version <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByName
Set-CMPackage -Name <String> [-Description <String> ] [-DistributionPriority <Priorities> {High | Low | Normal} ] [-ForcedDisconnectDelay <Int32> ] [-ForcedDisconnectEnabled <Boolean> ] [-ForcedDisconnectNumberRetries <Int32> ] [-Language <String> ] [-Manufacturer <String> ] [-MifFileName <String> ] [-MifName <String> ] [-MifPublisher <String> ] [-MifVersion <String> ] [-NewName <String> ] [-Path <String> ] [-SecuredScopeNames <String> ] [-ShareName <String> ] [-ShareType <ShareTypes> {ShareCommon | ShareSpecific} ] [-Version <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByValue
Set-CMPackage -InputObject <IResultObject> [-Description <String> ] [-DistributionPriority <Priorities> {High | Low | Normal} ] [-ForcedDisconnectDelay <Int32> ] [-ForcedDisconnectEnabled <Boolean> ] [-ForcedDisconnectNumberRetries <Int32> ] [-Language <String> ] [-Manufacturer <String> ] [-MifFileName <String> ] [-MifName <String> ] [-MifPublisher <String> ] [-MifVersion <String> ] [-NewName <String> ] [-Path <String> ] [-ShareName <String> ] [-ShareType <ShareTypes> {ShareCommon | ShareSpecific} ] [-Version <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-CMPackage cmdlet changes configuration settings for Microsoft System Center 2012 SP1 Configuration Manager packages.

If you set the MifFileName parameter, System Center 2012 Configuration Manager looks in the %TEMP% directory or the %windir% directory for the installation status Management Information Format (MIF) file that you specified in MifFileName. The installation status indicates whether the program successfully ran.

If System Center 2012 Configuration Manager does not find the file, it searches for all MIF files in those directories. System Center 2012 Configuration Manager makes a case-insensitive comparison of the values that you specify for MifName, MifPublisher, and MifVersion to the values that the MIF file specifies. If System Center 2012 Configuration Manager finds a match, it uses the status that the MIF file specifies as the installation status for the program. If System Center 2012 Configuration Manager cannot find a match, or if you do not specify MifFileName, System Center 2012 Configuration Manager uses the program exit code to set the installation status for the program. An exit code of zero indicates that the program successfully ran. Any other values indicate application-specific error codes.

Parameters

-Description<String>

Specifies a description for the package. You can use a maximum of 128 characters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DistributionPriority<Priorities>

Specifies the sending priority for the deployment package. Configuration Manager uses the sending priority for the deployment package when it sends the package to distribution points at child sites. The acceptable values for this parameter are:

-- High
-- Medium
-- Low

Configuration Manager sends packages in priority order. Configuration Manager sends packages that have the same priority in order of creation. Unless a backlog exists, Configuration Manager sends a package immediately regardless of its priority.

Aliases

Priority

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ForcedDisconnectDelay<Int32>

Specifies the time, in minutes, that Configuration Manager waits before it forcibly disconnects users from the distribution point share. The default value is 5.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ForcedDisconnectEnabled<Boolean>

Indicates whether Configuration Manager forcibly disconnects users from the distribution point share when a share violation occurs in updating, refreshing, or deleting package source files.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ForcedDisconnectNumberRetries<Int32>

Specifies the number of times Configuration Manager attempts to disconnect a user from the distribution point share. The default value is 2.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of package IDs.

Aliases

PackageId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies a CMPackage object. To obtain a CMPackage object, use the Get-CMPackage cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Language<String>

Specifies the language version of the package. You can use a maximum of 32 characters in a format that you choose to use to identify the language version. Configuration Manager uses the Language parameter together with Manufacturer, Name, and Version parameters to identify a package. For example, you can have an English version and a German version of the same package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Manufacturer<String>

Specifies a manufacturer name to help you identify the package. You can use a maximum of 32 characters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MifFileName<String>

Specifies the name of the MIF file that contains the package status.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MifName<String>

Specifies the name of the MIF file that contains the program status for the package. The file name extension must be .mif.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MifPublisher<String>

Specifies the name of the software publisher of the package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MifVersion<String>

Specifies the version number of the MIF file.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies a package name.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NewName<String>

Specifies a new name for the package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Path<String>

Specifies the location of the files of update contents for the package.

You can specify either a full local path or a Universal Naming Convention (UNC) path. Make sure that this location contains all the files and subdirectories that the program needs to run, including any scripts.

Aliases

PackageSourcePath

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecuredScopeNames<String>

Specifies names of security scopes. A security scope name can be Default or the name of a custom-created security scope.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ShareName<String>

Specifies the UNC share location to use on the distribution point. You can include directories in the share name. If the directories do not exist, Configuration Manager creates them. You must specify a share name if you set the ShareType parameter to SHARE_SPECIFIC.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ShareType<ShareTypes>

Specifies the type of share that the distribution point uses when it shares the package. The acceptable values for this parameter are:

-- SHARE_COMMON
-- SHARE_SPECIFIC

The default value is SHARE_COMMON. If you specify SHARE_SPECIFIC, you must specify a value for the ShareName parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Version<String>

Specifies a version number for the package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Rename a package and add a description

This command renames the package that has the ID ST120001. The command changes the name of the package to ScriptsPackage02 and adds a description for the package.

PS C:\> Set-CMPackage -Id "ST120001" -NewName "ScriptsPackage02" -Description "This package deploys scripts that run on a recurring schedule."

Example 2: Rename a package by using an object variable

The first command gets the package that has the ID ST120001, and stores the results in the $Pkg variable.

The second command changes the name of the package stored in $Pkg to ScriptsPackage02, and adds a description for the package.

PS C:\> $Pkg = Get-CMPackage -Id ST120001
PS C:\> Set-CMPackage -InputObject $Pkg -Newname "ScriptsPackage02" -Description "This package deploys scripts that run on a recurring schedule."

Export-CMPackage

Get-CMPackage

Import-CMPackage

New-CMPackage

Remove-CMPackage