Add-CMDeploymentTypeReturnCode
Add return codes to a supported application deployment type.
Syntax
Add-CMDeploymentTypeReturnCode
-InputObject <IResultObject>
-ReturnCode <Int32>
[-CodeType <ExitCodeClass>]
[-Name <String>]
[-Description <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Starting in version 2107, use this cmdlet to add return codes to a supported 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: Add return code 1602 to an MSI deployment type
This example adds the 1602
return code to the specified application deployment type.
$appName = "CenterApp"
$dtName = "InterDept - Windows Installer (.msi file)"
$msi_dt = Get-CMDeploymentType -ApplicationName $appName -DeploymentTypeName $dtName
Add-CMDeploymentTypeReturnCode -InputObject $msi_dt -ReturnCode 1602 -Name "User cancel" -CodeType Failure -Description "The user cancelled the installation"
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.
Type: | ExitCodeClass |
Accepted values: | Failure, Success, FastRetry, HardReboot, SoftReboot |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-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 |
-Description
Specify an optional description to help you identify and describe this return code.
Type: | String |
Aliases: | ReturnCodeDescription |
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 |
-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 |
-InputObject
Specify a deployment type object on which to add the return code. To get this object, use the Get-CMDeploymentType cmdlet.
Type: | IResultObject |
Aliases: | DeploymentType |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specify an optional name to describe this return code.
Type: | String |
Aliases: | ReturnCodeName |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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
.
Type: | Int32 |
Aliases: | ReturnCodeValue |
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
Outputs
IResultObject
Notes
For more information on this return object and its properties, see SMS_Application server WMI class.