Edit

Share via


New-CMTSStepUpgradeOperatingSystem

Create an Upgrade OS step, which you can add to a task sequence.

Syntax

Default (Default)

New-CMTSStepUpgradeOperatingSystem
    [-DriverPackage <IResultObject>]
    [-DynamicUpdateSetting <DynamicUpdateOption>]
    [-EditionIndex <Int32>]
    [-IgnoreMessage <Boolean>]
    [-ProductKey <String>]
    [-ScanOnly <Boolean>]
    [-SetupTimeout <Int32>]
    [-SourcePath <String>]
    [-StagedContent <String>]
    [-UpgradePackage <IResultObject>]
    [-SoftwareUpdate <IResultObject[]>]
    [-Condition <IResultObject[]>]
    [-ContinueOnError]
    [-Description <String>]
    [-Disable]
    -Name <String>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet creates a new Upgrade OS step object. Then use the Add-CMTaskSequenceStep cmdlet to add the step to a task sequence. For more information on this step, see About task sequence steps: Upgrade OS.

Note

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

Examples

Example 1

This example first uses the Get-CMOperatingSystemInstaller cmdlet to get an object for the OS upgrade package. It saves this object in the $osUpgPkg variable. The next step creates an object for the Upgrade OS step, using the $osUpgPkg object as the OS upgrade package.

It then gets a task sequence object, and adds this new step to the task sequence at index 11.

$osUpgPkg = Get-CMOperatingSystemInstaller -Name "OSUpgradePkg01"
$step = New-CMTSStepUpgradeOperatingSystem -Name "Upgrade OS" -UpgradePackage $osUpgPkg -EditionIndex 1

$tsNameOsd = "Default OS upgrade"
$tsUpg = Get-CMTaskSequence -Name $tsNameOsd -Fast

$tsUpg | Add-CMTaskSequenceStep -Step $step -InsertStepStartIndex 11

Parameters

-Condition

Specify a condition object to use with this step. To get this object, use one of the task sequence condition cmdlets. For example, Get-CMTSStepConditionVariable.

Parameter properties

Type:

IResultObject[]

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

Parameter sets

(All)
Position:Named
Mandatory:False
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: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

-ContinueOnError

Add this parameter to enable the step option Continue on error. When you enable this option, if the step fails, the task sequence continues.

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

-Description

Specify an optional description for this task sequence step.

Parameter properties

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

-Disable

Add this parameter to disable this task sequence step.

Parameter properties

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

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

-DriverPackage

Specify a driver package object to provide its driver content to Windows Setup during upgrade. To get this package, use the Get-CMDriverPackage cmdlet.

Use the StagedContent parameter to specify the location for the driver content.

Parameter properties

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

-DynamicUpdateSetting

Use this parameter to dynamically update Windows Setup with Windows Update.

  • DisablePolicy: Don't use Dynamic Update
  • UsingPolicy: Enable setup to use Dynamic Update, such as search, download, and install updates.
  • OverridePolicy: Temporarily override the local policy in real time to run Dynamic Update operations. The computer gets updates from Windows Update.

Parameter properties

Type:DynamicUpdateOption
Default value:None
Accepted values:DisablePolicy, UsingPolicy, OverridePolicy
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

-EditionIndex

Specify an integer value of the OS upgrade package edition. Use this parameter with the UpgradePackage parameter.

Parameter properties

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

-IgnoreMessage

Set this parameter to $true to specify that Windows Setup completes the installation, ignoring any dismissible compatibility messages.

Parameter properties

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

-Name

Specify a name for this step to identify it in the task sequence.

Parameter properties

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

Parameter sets

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

-ProductKey

Specify the product key to apply to the upgrade process.

Parameter properties

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

-ScanOnly

Set this parameter to $true to run the Windows Setup compatibility scan without starting upgrade.

Parameter properties

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

-SetupTimeout

Specify the number of minutes before Configuration Manager fails this step. This option is useful if Windows Setup stops processing but doesn't terminate.

Parameter properties

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

-SoftwareUpdate

Starting in version 2107, specify a software update object to upgrade a client's Windows OS by using a feature update. To get this object, use the Get-CMSoftwareUpdate cmdlet.

Parameter properties

Type:

IResultObject[]

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

-SourcePath

Specify a local or network path to the Windows media that Windows Setup uses.

Parameter properties

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

-StagedContent

Use this parameter with DriverPackage to specify the location for the driver content. You can specify a local folder, network path, or a task sequence variable.

Parameter properties

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

-UpgradePackage

Specify an OS upgrade package object. Use the EditionIndex parameter to set the edition.

To get this object, use the Get-CMOperatingSystemInstaller cmdlet.

Parameter properties

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

-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

None

Outputs

IResultObject

Notes

For more information on this return object and its properties, see SMS_TaskSequence_UpgradeOperatingSystemAction server WMI class.