Set-CMScriptDeploymentType

Sets a script installer deployment type.

Syntax

Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-RemoveDetectionClause <String[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-InstallCommand <String>]
   [-UninstallCommand <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-CacheContent <Boolean>]
   [-RequireUserInteraction <Boolean>]
   [-ContentFallback <Boolean>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-InstallWorkingDirectory <String>]
   [-UninstallWorkingDirectory <String>]
   [-Force32Bit <Boolean>]
   [-ProductCode <String>]
   [-ScriptText <String>]
   [-ScriptFile <String>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-ScriptLanguage <ScriptLanguage>]
   [-SourceUpdateProductCode <String>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-AddRequirement <Rule[]>]
   -DeploymentTypeName <String>
   -Application <IResultObject>
   [-NewName <String>]
   [-RemoveRequirement <Rule[]>]
   [-RemoveLanguage <String[]>]
   [-PassThru]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-RemoveDetectionClause <String[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-InstallCommand <String>]
   [-UninstallCommand <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-CacheContent <Boolean>]
   [-RequireUserInteraction <Boolean>]
   [-ContentFallback <Boolean>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-InstallWorkingDirectory <String>]
   [-UninstallWorkingDirectory <String>]
   [-Force32Bit <Boolean>]
   [-ProductCode <String>]
   [-ScriptText <String>]
   [-ScriptFile <String>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-ScriptLanguage <ScriptLanguage>]
   [-SourceUpdateProductCode <String>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-AddRequirement <Rule[]>]
   -ApplicationId <Int32>
   -DeploymentTypeName <String>
   [-NewName <String>]
   [-RemoveRequirement <Rule[]>]
   [-RemoveLanguage <String[]>]
   [-PassThru]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-RemoveDetectionClause <String[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-InstallCommand <String>]
   [-UninstallCommand <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-CacheContent <Boolean>]
   [-RequireUserInteraction <Boolean>]
   [-ContentFallback <Boolean>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-InstallWorkingDirectory <String>]
   [-UninstallWorkingDirectory <String>]
   [-Force32Bit <Boolean>]
   [-ProductCode <String>]
   [-ScriptText <String>]
   [-ScriptFile <String>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-ScriptLanguage <ScriptLanguage>]
   [-SourceUpdateProductCode <String>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-AddRequirement <Rule[]>]
   -ApplicationName <String>
   -DeploymentTypeName <String>
   [-NewName <String>]
   [-RemoveRequirement <Rule[]>]
   [-RemoveLanguage <String[]>]
   [-PassThru]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-RemoveDetectionClause <String[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-InstallCommand <String>]
   [-UninstallCommand <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-CacheContent <Boolean>]
   [-RequireUserInteraction <Boolean>]
   [-ContentFallback <Boolean>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-InstallWorkingDirectory <String>]
   [-UninstallWorkingDirectory <String>]
   [-Force32Bit <Boolean>]
   [-ProductCode <String>]
   [-ScriptText <String>]
   [-ScriptFile <String>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-ScriptLanguage <ScriptLanguage>]
   [-SourceUpdateProductCode <String>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-AddRequirement <Rule[]>]
   -InputObject <IResultObject>
   [-NewName <String>]
   [-RemoveRequirement <Rule[]>]
   [-RemoveLanguage <String[]>]
   [-PassThru]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-CMScriptDeploymentType cmdlet changes the settings for a script installer deployment type.

Examples

Example 1: Modify a script installer deployment type

PS C:\> Set-CMScriptDeploymentType -ApplicationName "application01" -DeploymentTypeName "ScriptDT01" -Comment "Script updated to uninstall" -UninstallCommand 'msiexec /x ""\\Machine01\Resources\Applications\MSI\AdvertMSI\AdvertMSI.msi" /q' -ScriptLanguage Powershell -ScriptText "update script text"

This command adds an uninstall command to the script installer deployment type named ScriptDT01 for the application named application01. The command also specifies the language of the script used to detect this deployment type as PowerShell.

Example 2: Modify a script installer deployment type by using the pipeline

PS C:\> Get-CMDeploymentType -ApplicationName "application01" -DeploymentTypeName "ScriptDT02" | Set-CMScriptDeploymentType -Comment "Script updated to uninstall" -UninstallCommand 'msiexec /x ""\\Machine01\Resources\Applications\MSI\AdvertMSI\AdvertMSI.msi" /q' -ScriptLanguage PowerShell -ScriptText "update script text"

This command gets the script installer deployment type object named ScriptDT02 for the application named application01 and uses the pipeline operator to pass the object to Set-CMScriptDeploymentType. Set-CMScriptDeploymentType adds an uninstall command, and specifies the language of the script used to detect this deployment type as PowerShell.

Required Parameters

-Application

Specifies an application object that is associated with this deployment type. To obtain an application object, use the Get-CMApplication cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ApplicationId

Specifies the ID of the application that is associated with this deployment type.

Type:Int32
Aliases:CI_ID, CIId
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ApplicationName

Specifies the name of the application that is associated with this deployment type.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DeploymentTypeName

Specifies a display name for this deployment type.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a deployment type object. To obtain a deployment type object, use the Get-CMDeploymentType cmdlet.

Type:IResultObject
Aliases:DeploymentType
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-AddDetectionClause
Type:DetectionClause[]
Aliases:AddDetectionClauses
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AddLanguage

Specifies an array of languages that the deployment type supports.

Type:String[]
Aliases:AddLanguages, Languages, Language
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AddRequirement

Specifies an array of requirements for the deployment type.

Type:Rule[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CacheContent

Indicates whether the deployment type saves content in cache indefinitely on the client computer.

Type:Boolean
Aliases:PersistContentInClientCache
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Comment

Specifies a description for the deployment type.

Type:String
Aliases:AdministratorComment
Position:Named
Default value:None
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:False
Accept pipeline input:False
Accept wildcard characters:False
-ContentFallback

Indicates whether clients can use a fallback location provided by a management point. A fallback location point provides an alternate location for source content when the content for the deployment type is not available on any preferred distribution points.

Type:Boolean
Aliases:EnableContentLocationFallback, AllowClientsToUseFallbackSourceLocationForContent
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ContentLocation

Specifies the path of the content. The site system server requires permission to read the content files.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

Indicates that clients that use Windows BranchCache are allowed to download content from an on-premises distribution point. Content downloads from cloud-based distribution points can always be shared by clients that use Windows BranchCache.

Type:Boolean
Aliases:AllowClientsToShareContentOnSameSubnet
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EstimatedRuntimeMins

Specifies the estimated installation time, in minutes, of the deployment program for the application. This estimate is displayed to the user before the application installs.

Type:Int32
Aliases:EstimatedInstallationTimeMinutes, EstimatedInstallationTimeMins, EstimatedRunTimeMinutes
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Aliases:ForceForUnknownPublisher
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force32Bit

Indicates that the deployment type uses the Microsoft Windows-32-on-Windows-64 (WOW64) subsystem to run the installation on a 64-bit client computer.

Type:Boolean
Aliases:Force32BitInstaller
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceScriptDetection32Bit

Indicates that the deployment type uses the Microsoft Windows-32-on-Windows-64 (WOW64) subsystem to run a script on a 64-bit client computer.

Type:Boolean
Aliases:Force32BitDetectionScript
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

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

Specifies the install command line for the Windows Installer package.

Type:String
Aliases:InstallationProgram
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstallWorkingDirectory

Specifies the folder that contains the installation program for the deployment type. This folder can be an absolute path on the client, or a path to the distribution point folder that contains the installation files.

Type:String
Aliases:InstallationStartIn, InstallFolder
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstallationBehaviorType

Specifies the installation behavior of the deployment type. Valid values are:

  • InstallForSystem
  • InstallForSystemIfResourceIsDeviceOtherwiseInstallForUser
  • InstallForUser
Type:InstallationBehaviorType
Parameter Sets:InstallForUser, InstallForSystem, InstallForSystemIfResourceIsDeviceOtherwiseInstallForUser
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LogonRequirementType

Specifies the logon requirement for the deployment type. Valid values are:

  • OnlyWhenNoUserLoggedOn
  • OnlyWhenUserLoggedOn
  • WhereOrNotUserLoggedOn
Type:LogonRequirementType
Parameter Sets:OnlyWhenUserLoggedOn, WhereOrNotUserLoggedOn, WhetherOrNotUserLoggedOn, OnlyWhenNoUserLoggedOn
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaximumRuntimeMins

Specifies the maximum run time, in minutes, of the deployment program for this application.

Type:Int32
Aliases:MaximumAllowedRunTimeMinutes, MaximumAllowedRunTimeMins, MaximumRunTimeMinutes
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NewName

Specifies a new name for this deployment type.

Type:String
Aliases:NewDeploymentTypeName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Returns the current working object. By default, this cmdlet does not generate any output.

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

Specifies the product code in the detection method for the deployment type.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RebootBehavior
Type:PostExecutionBehavior
Parameter Sets:BasedOnExitCode, NoAction, ForceReboot, ProgramReboot
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RemoveDetectionClause
Type:String[]
Aliases:RemoveDetectionClauses
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RemoveLanguage

Removes the existing supported languages from this deployment type.

Type:String[]
Aliases:RemoveLanguages
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RemoveRequirement

Removes the existing installation requirements from this deployment type.

Type:Rule[]
Aliases:RemoveRequirements
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RequireUserInteraction

Indicates whether a user can interact with the deployment type installation to configure the installation options.

Type:Boolean
Aliases:RequiresUserInteraction
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ScriptFile
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ScriptLanguage

Specifies the script language that you want to use to detect this deployment type. Valid values are:

  • PowerShell
  • VBScript
  • JavaScript
Type:ScriptLanguage
Aliases:ScriptType
Parameter Sets:PowerShell, VBScript, JavaScript
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ScriptText

Specifies the script to use to detect this deployment type.

Type:String
Aliases:ScriptContent, Script
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SlowNetworkDeploymentMode

Specifies the installation behavior of the deployment type on a slow network. Valid values are:

  • DoNothing
  • Download
  • DownloadContentForStreaming
Type:ContentHandlingMode
Parameter Sets:DoNothing, Download
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourceUpdateProductCode

Specifies the Windows Installer product code to enable installation source management. Windows Source management enables an MSI represented by this deployment type to be automatically updated or repaired from content source files on an available distribution point.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UninstallCommand

Specifies the command to use to uninstall the Windows Installer package from the command line.

Type:String
Aliases:UninstallationProgram
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UninstallWorkingDirectory

Specifies the folder that contains the uninstall program for the deployment type. This folder can be an absolute path on the client, or a path that is relative to the distribution point folder that contains the package.

Type:String
Aliases:UninstallationStartIn, UninstallFolder
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserInteractionMode

Specifies the mode in which the deployment type runs on client devices. Valid values are:

  • Normal
  • Minimized
  • Maximized
  • Hidden
Type:UserInteractionMode
Aliases:InstallationProgramVisibility
Parameter Sets:Normal, Minimized, Maximized, Hidden
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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