Edit

Share via


Remove-CMSoftwareUpdateFromPackage

Remove an update from a software update package.

Syntax

ById_Id (Default)

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdateId <String[]>
    -SoftwareUpdatePackageId <String>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObject_Id

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdate <IResultObject[]>
    -SoftwareUpdatePackageId <String>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObject_Name

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdate <IResultObject[]>
    -SoftwareUpdatePackageName <String>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObject_Object

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdate <IResultObject[]>
    -SoftwareUpdatePackage <IResultObject>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ById_Name

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdateId <String[]>
    -SoftwareUpdatePackageName <String>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ById_Object

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdateId <String[]>
    -SoftwareUpdatePackage <IResultObject>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByName_Id

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdateName <String[]>
    -SoftwareUpdatePackageId <String>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByName_Name

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdateName <String[]>
    -SoftwareUpdatePackageName <String>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByName_Object

Remove-CMSoftwareUpdateFromPackage
    -SoftwareUpdateName <String[]>
    -SoftwareUpdatePackage <IResultObject>
    [-RefreshDistributionPoint]
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet to remove the specified software update from a package.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Remove an update and refresh the content

This example first gets the ID of a software update. It then gets a software update package by its ID. The last command removes the update from the package. It refreshes the content on the distribution point, and doesn't prompt for confirmation.

$SU0 = "Bing Bar 7.1 (KB2673770)"
$SU0_ID = ( Get-CMSoftwareUpdate -Name $SU0 -Fast ).CI_ID

$suppkg1 = Get-CMSoftwareUpdateDeploymentPackage -Id "XYZ0000C"

Remove-CMSoftwareUpdateFromPackage -SoftwareUpdatePackageId $suppkg1.PackageID -SoftwareUpdateId $SU0_ID -RefreshDistributionPoint -Force

Example 2: Remove two updates but don't refresh the content

This example first defines the names of two software updates. It then gets a software update package by its ID. The last command removes both software updates from the package. Since this command doesn't include the Force parameter, it prompts for confirmation. Since it doesn't include the RefreshDistributionPoint parameter, you need to manually update the content on distribution points.

$SU1 = "Bing Bar 7.1 (KB2673771)"
$SU2 = "Bing Bar 7.1 (KB2673772)"

$suppkg1 = Get-CMSoftwareUpdateDeploymentPackage -Id "XYZ0000C"

Remove-CMSoftwareUpdateFromPackage -SoftwareUpdatePackage $suppkg1 -SoftwareUpdateName ($SU1, $SU2)

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
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

-Force

Add this parameter to run the command without asking for confirmation.

Parameter properties

Type:SwitchParameter
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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
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

-RefreshDistributionPoint

Add this parameter to update the package content on the distribution points. If you don't include this parameter, you need to manually update distribution points. For more information, see Manage distributed content.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RefreshDistributionPointAfterRemoveSoftwareUpdateFromPackage

Parameter sets

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

-SoftwareUpdate

Specify an array of software update objects to remove from the package. To get this object, use the Get-CMSoftwareUpdate cmdlet.

Parameter properties

Type:

IResultObject[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:SoftwareUpdates

Parameter sets

ByObject_Id
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByObject_Name
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByObject_Object
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SoftwareUpdateId

Specify an array of IDs for software updates to remove from the package. This value is the CI_ID of the update, for example 1584792.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:SoftwareUpdateIds

Parameter sets

ById_Id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ById_Name
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ById_Object
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SoftwareUpdateName

Specify an array of names for software updates to remove from the package.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False
Aliases:SoftwareUpdateNames

Parameter sets

ByName_Id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByName_Name
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByName_Object
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SoftwareUpdatePackage

Specify a software update package object from which to remove the updates. To get this object, use the Get-CMSoftwareUpdateDeploymentPackage cmdlet.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByObject_Object
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ById_Object
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByName_Object
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SoftwareUpdatePackageId

Specify a software update package ID from which to remove the updates. This value is a standard package ID, for example XYZ0035E.

Parameter properties

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

Parameter sets

ById_Id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByObject_Id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByName_Id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SoftwareUpdatePackageName

Specify a software update package name from which to remove the updates.

Parameter properties

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

Parameter sets

ByObject_Name
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ById_Name
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByName_Name
Position:Named
Mandatory:True
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 doesn't run.

Parameter properties

Type:SwitchParameter
Default value:None
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

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object