New-​CM​Program

Creates a new program in Configuration Manager.

Syntax

New-CMProgram
   [-AddSupportedOperatingSystemPlatform <IResultObject[]>]
   -CommandLine <String>
   [-Confirm]
   [-DisableWildcardHandling]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DriveLetter <String>]
   [-DriveMode <DriveModeType>]
   [-Duration <Int32>]
   [-ForceWildcardHandling]
   -PackageName <String>
   [-ProgramRunType <ProgramRunType>]
   [-Reconnect <Boolean>]
   [-RunMode <RunModeType>]
   [-RunType <RunType>]
   -StandardProgramName <String>
   [-UserInteraction <Boolean>]
   [-WhatIf]
   [-WorkingDirectory <String>]
   [<CommonParameters>]
New-CMProgram
   [-AddSupportedOperatingSystemPlatform <IResultObject[]>]
   -CommandLine <String>
   [-Confirm]
   [-DisableWildcardHandling]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DriveLetter <String>]
   [-DriveMode <DriveModeType>]
   [-Duration <Int32>]
   [-ForceWildcardHandling]
   -PackageId <String>
   [-ProgramRunType <ProgramRunType>]
   [-Reconnect <Boolean>]
   [-RunMode <RunModeType>]
   [-RunType <RunType>]
   -StandardProgramName <String>
   [-UserInteraction <Boolean>]
   [-WhatIf]
   [-WorkingDirectory <String>]
   [<CommonParameters>]
New-CMProgram
   -CommandLine <String>
   [-CommandLineFolder <String>]
   [-Comment <String>]
   [-Confirm]
   -DeviceProgramName <String>
   [-DisableWildcardHandling]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DownloadProgramType <DownloadProgramType>]
   [-ForceWildcardHandling]
   -PackageName <String>
   [-Requirement <String>]
   [-WhatIf]
   [-WorkingDirectory <String>]
   [<CommonParameters>]
New-CMProgram
   -CommandLine <String>
   [-CommandLineFolder <String>]
   [-Comment <String>]
   [-Confirm]
   -DeviceProgramName <String>
   [-DisableWildcardHandling]
   [-DiskSpaceRequirement <String>]
   [-DiskSpaceUnit <DiskSpaceUnitType>]
   [-DownloadProgramType <DownloadProgramType>]
   [-ForceWildcardHandling]
   -PackageId <String>
   [-Requirement <String>]
   [-WhatIf]
   [-WorkingDirectory <String>]
   [<CommonParameters>]

Description

The New-CMProgram cmdlet creates a program in Microsoft System Center Configuration Manager. Programs are commands that are associated with a System Center Configuration Manager package. Programs identify the actions that occur when the client receives the client package. You can associate multiple programs with the same package.

Examples

Example 1: Create a standard program

PS C:\> New-CMProgram -PackageName "test" -StandardProgramName SPM -CommandLine "RunMe" -WorkingDirectory "C:\temp" -RunType Hidden -ProgramRunType OnlyWhenNoUserIsLoggedOn -DiskSpaceRequirement 100 -DiskSpaceUnit GB -Duration 100 -DriveMode RenameWithUnc

This command creates a standard program in Configuration Manager.

Example 2: Create a device program

PS C:\> New-CMProgram -PackageName "Contoso-12" -DeviceProgramName DPM -Comment "Upgrades for December" -WorkingDirectory "C:\temp" -CommandLine "RunMe" -CommandLineFolder "C:\Windows\" -DiskSpaceRequirement 10 -DiskSpaceUnit GB -DownloadProgramType OnlyWhenTheDeviceIsDocked -Requirement "All previous updates"

This command creates a device program in Configuration Manager.

Required Parameters

-CommandLine

Specifies the command line for the program.

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

Specifies a device program name.

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

Specifies a package name.

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

Specifies the standard program name.

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

Optional Parameters

-AddSupportedOperatingSystemPlatform

{{Fill AddSupportedOperatingSystemPlatform Description}}

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

Specifies 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
Accept pipeline input:False
Accept wildcard characters:False
-Comment

Specifies optional text about a program, such as a description. On client computers, this text is displayed in Run Advertised Programs in Control Panel.

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

Specifies the amount of disk space that the software program requires to run on the computer. If a value is specified, units for the value must also be specified. The value must be greater than or equal to zero.

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

Specifies the units for the DiskSpaceRequirement parameter. The acceptable values for this parameter are: GB, KB, and MB.

Type:DiskSpaceUnitType
Parameter Sets:KB, MB, GB
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DownloadProgramType

Specifies when the program is to run. The acceptable values for this parameter are:- AsSoonAsPossible

  • OnlyOverFastNetwork
  • OnlyWhenTheDeviceIsLocked.
Type:DownloadProgramType
Parameter Sets:AsSoonAsPossible, OnlyOverFastNetwork, OnlyWhenTheDeviceIsDocked
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DriveLetter

Specifies a drive letter to qualify the location if the DriveMode parameter is used.

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

Indicates whether the program requires a specific drive letter, specified in the DriveLetter parameter. By default, the program runs with a Universal Naming Convention (UNC) name. If DriveMode is set to RequiresDriveLetter, the program uses any available drive letter. If DriveMode is set to RequiresSpecificDriveLetter, the program only runs if the drive is not already in use.

Type:DriveModeType
Parameter Sets:RenameWithUnc, RequiresDriveLetter, RequiresSpecificDriveLetter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Duration

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

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

Specifies the logon conditions that are necessary for the program to run. The acceptable values for this parameter are:- OnlyWhenNoUserIsLoggedOn

  • OnlyWhenUserIsLoggedOn
  • WhetherOrNotUserIsLoggedOn

    The default setting is OnlyWhenUserIsLoggedOn.
Type:ProgramRunType
Parameter Sets:OnlyWhenUserIsLoggedOn, WhetherOrNotUserIsLoggedOn, OnlyWhenNoUserIsLoggedOn
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Reconnect

Indicates whether the client computer reconnects to the distribution point when the user logs on.

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

Specifies additional requirements for standard or device programs.

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

Specifies the credentials that the program requires to run on the client computer. The acceptable values for this parameter are: RunWithAdministrativeRights and RunWithUserRights.

Type:RunModeType
Parameter Sets:RunWithUserRights, RunWithAdministrativeRights
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunType

Specifies the mode is which the program will run on the client computer. The acceptable values for this parameter are:- Hidden

  • Maximized
  • Minimized
  • Normal

    The default is Normal.
Type:RunType
Parameter Sets:Normal, Minimized, Maximized, Hidden
Position:Named
Default value:None
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
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
-WorkingDirectory

Specifies a working directory for the program.

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