New-CMProgram
New-CMProgram
Creates a new program in Configuration Manager.
Syntax
Parameter Set: NewStandardProgram
New-CMProgram -CommandLine <String> -PackageName <String> -StandardProgramName <String> [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DriveLetter <String> ] [-DriveMode <DriveModeType> {RenameWithUnc | RequiresDriveLetter | RequiresSpecificDriveLetter} ] [-Duration <Int32> ] [-ProgramRunType <ProgramRunType> {OnlyWhenNoUserIsLoggedOn | OnlyWhenUserIsLoggedOn | WhetherOrNotUserIsLoggedOn} ] [-Reconnect <Boolean> ] [-RunMode <RunModeType> {RunWithAdministrativeRights | RunWithUserRights} ] [-RunType <RunType> {Hidden | Maximized | Minimized | Normal} ] [-UserInteraction <Boolean> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: NewDeviceProgram
New-CMProgram -CommandLine <String> -DeviceProgramName <String> -PackageName <String> [-CommandLineFolder <String> ] [-Comment <String> ] [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DownloadProgramType <DownloadProgramType> {AsSoonAsPossible | OnlyOverFastNetwork | OnlyWhenTheDeviceIsDocked} ] [-Requirement <String> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The New-CMProgram cmdlet creates a new program in Microsoft System Center 2012 Configuration Manager. Programs are commands that are associated with a System Center 2012 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.
Parameters
-CommandLine<String>
Specifies the command line for the program.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-CommandLineFolder<String>
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Comment<String>
Specifies optional text about a program, such as a description. On client computers, this text is displayed in Run Advertised Programs in Control Panel.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DeviceProgramName<String>
Specifies a device program name.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DiskSpaceRequirement<String>
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.
Aliases |
DiskSpaceReq |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DiskSpaceUnit<DiskSpaceUnitType>
Specifies the units, GB, KB, or MB, for the DiskSpaceRequirement parameter
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DownloadProgramType<DownloadProgramType>
Specifies when the program is to run. Valid values for this parameter are: AsSoonAsPossible, OnlyOverFastNetwork, and OnlyWhenTheDeviceIsLocked.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DriveLetter<String>
Specifies a drive letter to qualify the location if the DriveMode parameter is used.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DriveMode<DriveModeType>
Indicates whether the program requires a specific drive letter, specified in the DriveLetter parameter. By default, the program runs with a Universal NC 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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Duration<Int32>
Specifies the maximum amount of time the program is expected to run. The default value is 120 minutes.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-PackageName<String>
Specifies a package name.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ProgramRunType<ProgramRunType>
Specifies the logon conditions that are necessary for the program to run. Valid values for this parameter are: OnlyWhenNoUserIsLoggedOn, OnlyWhenUserIsLoggedOn, and WhetherOrNotUserIsLoggedOn. The default setting is OnlyWhenUserIsLoggedOn.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Reconnect<Boolean>
Indicates whether the client computer reconnects to the distribution point when the user logs on.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Requirement<String>
Specifies additional requirements for standard or device programs.
Aliases |
Requirements |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-RunMode<RunModeType>
Specifies the credentials that the program requires to run on the client computer, either RunWithAdministrativeRights or RunWithUserRights.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-RunType<RunType>
Specifies the mode is which the program will run on the client computer. Valid values for this parameter are: Hidden, Maximized, Minimized, and Normal. The default is Normal.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-StandardProgramName<String>
Specifies the standard program name.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-UserInteraction<Boolean>
Indicates whether to allow users to interact with the program.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-WorkingDirectory<String>
Specifies a working directory for the program.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Create a new standard program
This command creates a new standard program in Configuration Manager.
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
Example 2: Create a new device program
This command creates a new device program in Configuration Manager
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"