Bewerken

Delen via


Remove-CMSoftwareUpdateFromPackage

Remove an update from a software update package.

Syntax

Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdateId <String[]>
      -SoftwareUpdatePackageId <String>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdate <IResultObject[]>
      -SoftwareUpdatePackageId <String>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdate <IResultObject[]>
      -SoftwareUpdatePackageName <String>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdate <IResultObject[]>
      -SoftwareUpdatePackage <IResultObject>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdateId <String[]>
      -SoftwareUpdatePackageName <String>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdateId <String[]>
      -SoftwareUpdatePackage <IResultObject>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdateName <String[]>
      -SoftwareUpdatePackageId <String>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSoftwareUpdateFromPackage
      -SoftwareUpdateName <String[]>
      -SoftwareUpdatePackageName <String>
      [-RefreshDistributionPoint]
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
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.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableWildcardHandling

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ForceWildcardHandling

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:SwitchParameter
Aliases:RefreshDistributionPointAfterRemoveSoftwareUpdateFromPackage
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SoftwareUpdate

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

Type:IResultObject[]
Aliases:SoftwareUpdates
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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.

Type:String[]
Aliases:SoftwareUpdateIds
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SoftwareUpdateName

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

Type:String[]
Aliases:SoftwareUpdateNames
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:True

-SoftwareUpdatePackage

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

Type:IResultObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SoftwareUpdatePackageId

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

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SoftwareUpdatePackageName

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

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject[]

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object