Set-CMProgram

Modify a program of a package.

Syntax

Set-CMProgram
   [-AddSupportedOperatingSystemPlatform <IResultObject[]>]
   [-AfterRunningType <AfterRunningType>]
   [-Category <String>]
   [-CommandLine <String>]
   [-Comment <String>]
   [-DisableMomAlertOnRun <Boolean>]
   [-DisableProgram <Boolean>]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DriveLetter <String>]
   [-DriveMode <DriveModeType>]
   [-Duration <Int32>]
   [-EnableTaskSequence <Boolean>]
   [-GenerateMomAlertOnFail <Boolean>]
   -InputObject <IResultObject>
   [-PassThru]
   [-ProgramAssignedType <ProgramAssignedType>]
   [-ProgramRunType <ProgramRunType>]
   [-Reconnect <Boolean>]
   [-RemoveSupportedOperatingSystemPlatform <IResultObject[]>]
   [-Requirement <String>]
   [-RunMode <RunModeType>]
   [-RunOnAnyPlatform]
   [-RunType <RunType>]
   [-StandardProgram]
   [-SuppressProgramNotification <Boolean>]
   [-UserInteraction <Boolean>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMProgram
   [-AddSupportedOperatingSystemPlatform <IResultObject[]>]
   [-AfterRunningType <AfterRunningType>]
   [-Category <String>]
   [-CommandLine <String>]
   [-Comment <String>]
   [-DisableMomAlertOnRun <Boolean>]
   [-DisableProgram <Boolean>]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DriveLetter <String>]
   [-DriveMode <DriveModeType>]
   [-Duration <Int32>]
   [-EnableTaskSequence <Boolean>]
   [-GenerateMomAlertOnFail <Boolean>]
   -PackageName <String>
   [-PassThru]
   [-ProgramAssignedType <ProgramAssignedType>]
   -ProgramName <String>
   [-ProgramRunType <ProgramRunType>]
   [-Reconnect <Boolean>]
   [-RemoveSupportedOperatingSystemPlatform <IResultObject[]>]
   [-Requirement <String>]
   [-RunMode <RunModeType>]
   [-RunOnAnyPlatform]
   [-RunType <RunType>]
   [-StandardProgram]
   [-SuppressProgramNotification <Boolean>]
   [-UserInteraction <Boolean>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMProgram
   [-AddSupportedOperatingSystemPlatform <IResultObject[]>]
   [-AfterRunningType <AfterRunningType>]
   [-Category <String>]
   [-CommandLine <String>]
   [-Comment <String>]
   [-DisableMomAlertOnRun <Boolean>]
   [-DisableProgram <Boolean>]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DriveLetter <String>]
   [-DriveMode <DriveModeType>]
   [-Duration <Int32>]
   [-EnableTaskSequence <Boolean>]
   [-GenerateMomAlertOnFail <Boolean>]
   -PackageId <String>
   [-PassThru]
   [-ProgramAssignedType <ProgramAssignedType>]
   -ProgramName <String>
   [-ProgramRunType <ProgramRunType>]
   [-Reconnect <Boolean>]
   [-RemoveSupportedOperatingSystemPlatform <IResultObject[]>]
   [-Requirement <String>]
   [-RunMode <RunModeType>]
   [-RunOnAnyPlatform]
   [-RunType <RunType>]
   [-StandardProgram]
   [-SuppressProgramNotification <Boolean>]
   [-UserInteraction <Boolean>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMProgram
   [-AddSupportedOperatingSystemPlatform <IResultObject[]>]
   [-AfterRunningType <AfterRunningType>]
   [-Category <String>]
   [-CommandLine <String>]
   [-Comment <String>]
   [-DisableMomAlertOnRun <Boolean>]
   [-DisableProgram <Boolean>]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DriveLetter <String>]
   [-DriveMode <DriveModeType>]
   [-Duration <Int32>]
   [-EnableTaskSequence <Boolean>]
   [-GenerateMomAlertOnFail <Boolean>]
   -InputObject <IResultObject>
   [-PassThru]
   [-ProgramAssignedType <ProgramAssignedType>]
   -ProgramName <String>
   [-ProgramRunType <ProgramRunType>]
   [-Reconnect <Boolean>]
   [-RemoveSupportedOperatingSystemPlatform <IResultObject[]>]
   [-Requirement <String>]
   [-RunMode <RunModeType>]
   [-RunOnAnyPlatform]
   [-RunType <RunType>]
   [-StandardProgram]
   [-SuppressProgramNotification <Boolean>]
   [-UserInteraction <Boolean>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMProgram
   [-CommandLine <String>]
   [-CommandLineFolder <String>]
   [-Comment <String>]
   [-DeviceProgram]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DownloadProgramType <DownloadProgramType>]
   -PackageName <String>
   [-PassThru]
   -ProgramName <String>
   [-Requirement <String>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMProgram
   [-CommandLine <String>]
   [-CommandLineFolder <String>]
   [-Comment <String>]
   [-DeviceProgram]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DownloadProgramType <DownloadProgramType>]
   -PackageId <String>
   [-PassThru]
   -ProgramName <String>
   [-Requirement <String>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMProgram
   [-CommandLine <String>]
   [-CommandLineFolder <String>]
   [-Comment <String>]
   [-DeviceProgram]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DownloadProgramType <DownloadProgramType>]
   -InputObject <IResultObject>
   [-PassThru]
   -ProgramName <String>
   [-Requirement <String>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMProgram
   [-CommandLine <String>]
   [-CommandLineFolder <String>]
   [-Comment <String>]
   [-DeviceProgram]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DownloadProgramType <DownloadProgramType>]
   -InputObject <IResultObject>
   [-PassThru]
   [-Requirement <String>]
   [-WorkingDirectory <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Use this cmdlet to modify a program of a package. Programs identify the actions that occur when the client receives the client package. You can associate multiple programs with the same package. For more information, see Packages and programs in Configuration Manager.

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 a standard program

Set-CMProgram -Name "Test" -StandardProgramName SPM -Comment "Standard Upgrades" -CommandLine "RunThisNow" -RunType Maximized -AfterRunningType ProgramControlsRestart -Category "Laptops" -DiskSpaceRequirement 50 -DiskSpaceUnit MB -Duration 150 -Requirement 4 -Reconnect $False -SuppressProgramNotifications $False -DisableProgram $True -EnableTaskSequence $True -DisableMomAlertOnRun $True -GenerateMomAlertOnFail $True

Example 2: Modify a device program

Set-CMProgram -Name "Test" -DeviceProgramName DPM -Comment "Upgrades for December" -CommandLine "RunMe" -WorkingDirectory "\TempWork" -CommandLineFolder "C:\Windows" -DiskSpaceRequirement 30 -DiskSpaceUnit MB -DownloadProgramType AsSoonAsPossible -Requirement "All previous device updates"

Example 3: Add a supported OS platform

This example sets the OS requirement for a program associated with a standard package. It uses the Get-CMSupportedPlatform cmdlet to get an object for the specified platform. It then uses this supported platform object to configure the program.

$ProgramName = 'Script'
$PackageID = 'XYZ0000D'
$Platform = 'All Windows 10 (64-bit) Client'
$OS = Get-CMSupportedPlatform -Name $Platform -Fast

Set-CMProgram -PackageID $PackageID -ProgramName $ProgramName -AddSupportedOperatingSystemPlatform $OS -StandardProgram

Parameters

-AddSupportedOperatingSystemPlatform

Specify one or more supported OS platforms to add for the program. To get this object, use the Get-CMSupportedPlatform cmdlet.

Type:IResultObject[]
Aliases:AddSupportedOperatingSystemPlatforms
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AfterRunningType

Specify the action that occurs after the program completes successfully.

Type:AfterRunningType
Accepted values:NoActionRequired, ConfigurationManagerRestartsComputer, ProgramControlsRestart, ConfigurationManagerLogsUserOff
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Category

Specify the category under which the program is displayed on the client computer.

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

-CommandLine

Specify the command line for the program.

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

-CommandLineFolder

Specify the folder that contains the executable program. This folder can be an absolute path on the client, or a path relative to the distribution folder that contains the package.

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

-Comment

Specify optional text about the program, such as a description. On client computers, this text displays with the program in Software Center.

Type:String
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeviceProgram

Add this parameter to configure this program as a device program.

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

-DisableMomAlertOnRun

Indicates whether the computer running the program is in maintenance mode for the duration of the program. When in maintenance mode, System Center Operations Manager disables alerts while the program runs.

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

-DisableProgram

Set this parameter to $true to temporarily disable all deployments that contain this program. You can also use the Disable-CMProgram cmdlet.

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

-DiskSpaceRequirement

Specify the amount of disk space that the software program requires to run on the computer. The value must be greater than or equal to zero. If you specify a value, use the DiskSpaceUnit parameter to specify units for the value.

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

-DiskSpaceUnit

Specify an accepted unit for the DiskSpaceRequirement parameter.

Type:DiskSpaceUnitType
Accepted values:KB, MB, GB
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DownloadProgramType

Specify when the program is to run.

Type:DownloadProgramType
Accepted values:AsSoonAsPossible, OnlyOverFastNetwork, OnlyWhenTheDeviceIsDocked
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DriveLetter

If you use the DriveMode parameter, specify a drive letter for the location.

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

-DriveMode

Indicates whether the program requires a specific drive letter, specified in the DriveLetter parameter.

  • RunWithUnc: Run the program from the UNC path. This value is the default. Starting in version 2010, this value was renamed from RenameWithUnc.

  • RequiresDriveLetter: The program uses any available drive letter.

  • RequiresSpecificDriveLetter: The program only runs if the drive isn't already in use.

Type:DriveModeType
Accepted values:RunWithUnc, RequiresDriveLetter, RequiresSpecificDriveLetter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Duration

Specifies the maximum amount of time that you expect the program to run. The default value is 120 minutes.

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

-EnableTaskSequence

Indicates whether this program can be installed from the Install Package task sequence step.

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

-GenerateMomAlertOnFail

Indicates whether Configuration Manager generates an application log event entry if the program fails.

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

-InputObject

Specify a program object to configure. To get this object, use the Get-CMProgram cmdlet.

Type:IResultObject
Aliases:ProgramPackage, Package, Program
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PackageId

Specify a package ID with the program to configure.

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

-PackageName

Specify a package name with the program to configure.

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

-PassThru

Returns an object representing the item with which you're working. By default, this cmdlet may not generate any output.

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

-ProgramAssignedType

Specify whether the program runs once on the computer, or once for every user who signs in to the computer. The default value is RunOnceForTheComputer. The program is only assigned to users when the ProgramRunType parameter is set to OnlyWhenUserIsLoggedOn.

Type:ProgramAssignedType
Accepted values:RunOnceForTheComputer, RunOnceForEveryUserWhoLogsOn
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProgramName

Specify the name of the program to configure.

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

-ProgramRunType

Specify the logon conditions that are necessary for the program to run. The default value is OnlyWhenUserIsLoggedOn.

Type:ProgramRunType
Accepted values:OnlyWhenUserIsLoggedOn, WhetherOrNotUserIsLoggedOn, OnlyWhenNoUserIsLoggedOn
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Reconnect

Indicates whether the client computer reconnects to the distribution point when the user signs in.

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

-RemoveSupportedOperatingSystemPlatform

Specify one or more supported OS platforms to remove for the program. To get this object, use the Get-CMSupportedPlatform cmdlet.

Type:IResultObject[]
Aliases:RemoveSupportedOperatingSystemPlatforms
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Requirement

Specify any additional requirements for standard or device programs.

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

-RunMode

Specify the credentials the client computer requires to run the program.

Type:RunModeType
Accepted values:RunWithUserRights, RunWithAdministrativeRights
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunOnAnyPlatform

Add this parameter to clear all supported OS platforms from this program.

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

-RunType

Specify the mode in which the program runs on the client computer. The default value is Normal.

Type:RunType
Accepted values:Normal, Minimized, Maximized, Hidden
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StandardProgram

Indicates that the program type in the deployment package is standard program.

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

-SuppressProgramNotification

Set this parameter to $true to suppress program notifications.

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

-UserInteraction

Indicates whether to allow users to interact with the program.

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

-WorkingDirectory

Specify a working directory for the program.

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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object