Edit

Set-CMDeploymentTypeReturnCode

Modify return codes for the specified application deployment type.

Syntax

Default (Default)

Set-CMDeploymentTypeReturnCode
    -InputObject <IResultObject>
    -ReturnCode <Int32>
    [-CodeType <ExitCodeClass>]
    [-NewName <String>]
    [-Description <String>]
    [-PassThru]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Starting in version 2107, use this cmdlet to modify return codes for the specified application deployment type. For more general information, see Deployment type Return Codes.

Note

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

Examples

Example 1: Modify the behavior of the 3010 return code

This example modifies the behavior of the default 3010 return code, which is the Soft Reboot type by default. It configures it as a Hard Reboot and changes the name and description.

$appName = "CenterApp"
$dtName = "InterDept - Windows Installer (.msi file)"
$msi_dt = Get-CMDeploymentType -ApplicationName $appName -DeploymentTypeName $dtName

Add-CMDeploymentTypeReturnCode -InputObject $msi_dt -ReturnCode 3010 -Name "Always reboot" -CodeType HardReboot -Description "Change soft reboot to hard reboot"

Parameters

-CodeType

Specify the type of return code. This setting defines how Configuration Manager interprets the specified return code from this deployment type. The available types vary based on the deployment type technology.

  • Failure: The deployment type failed to install.

  • Success: The deployment type successfully installed, and no reboot is necessary.

  • FastRetry: Another installation is already in progress on the device. The client retries every two hours, for a total of 10 times.

  • HardReboot: The deployment type successfully installed, but requires the device to restart. Nothing else can be installed until the device restarts.

  • SoftReboot: The deployment type successfully installed, but requests the device to restart. Other installations can occur before the device restarts.

Parameter properties

Type:ExitCodeClass
Default value:None
Accepted values:Failure, Success, FastRetry, HardReboot, SoftReboot
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

-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

-Description

Specify an optional description to help you identify and describe this return code.

Parameter properties

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

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

-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

-InputObject

Specify a deployment type object on which to modify the return code. To get this object, use the Get-CMDeploymentType cmdlet.

Parameter properties

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

Parameter sets

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

-NewName

Specify a new name to describe this return code.

Parameter properties

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

Parameter sets

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

-PassThru

Add this parameter to return an object that represents the item with which you're working. By default, this cmdlet may not generate any output.

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

-ReturnCode

Specify an integer value for the return code that you expect from this deployment type. This value is any positive or negative integer between -2147483648 and 2147483647.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ReturnCodeValue

Parameter sets

(All)
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

Outputs

IResultObject

Notes

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