New-CMProgram
New-CMProgram
Creates a new program in Configuration Manager.
構文
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>]
詳細説明
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.
パラメーター
-CommandLine<String>
Specifies the command line for the program.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
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.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
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.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-DeviceProgramName<String>
Specifies a device program name.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
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.
エイリアス |
DiskSpaceReq |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-DiskSpaceUnit<DiskSpaceUnitType>
Specifies the units, GB, KB, or MB, for the DiskSpaceRequirement parameter.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-DownloadProgramType<DownloadProgramType>
Specifies when the program is to run. Valid values are: AsSoonAsPossible, OnlyOverFastNetwork, and OnlyWhenTheDeviceIsLocked.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-DriveLetter<String>
Specifies a drive letter to qualify the location if the DriveMode parameter is used.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
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 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.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Duration<Int32>
Specifies the maximum amount of time the program is expected to run. The default value is 120 minutes.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-PackageName<String>
Specifies a package name.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-ProgramRunType<ProgramRunType>
Specifies the logon conditions that are necessary for the program to run. Valid values are: OnlyWhenNoUserIsLoggedOn, OnlyWhenUserIsLoggedOn, and WhetherOrNotUserIsLoggedOn. The default setting is OnlyWhenUserIsLoggedOn.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Reconnect<Boolean>
Indicates whether the client computer reconnects to the distribution point when the user logs on.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Requirement<String>
Specifies additional requirements for standard or device programs.
エイリアス |
Requirements |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-RunMode<RunModeType>
Specifies the credentials that the program requires to run on the client computer, either RunWithAdministrativeRights or RunWithUserRights.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-RunType<RunType>
Specifies the mode is which the program will run on the client computer. Valid values are: Hidden, Maximized, Minimized, and Normal. The default is Normal.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-StandardProgramName<String>
Specifies the standard program name.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-UserInteraction<Boolean>
Indicates whether to allow users to interact with the program.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-WorkingDirectory<String>
Specifies a working directory for the program.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Confirm
コマンドレットを実行する前に、ユーザーに確認を求めます。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-WhatIf
コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
例
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"