Set-SCScriptCommand

Set-SCScriptCommand

Configures a script command.

構文

Parameter Set: Default
Set-SCScriptCommand [-ScriptCommand] <SCScriptCommand> [-CommandParameters <String> ] [-DeploymentOrder <Int32]> ] [-Executable <String> ] [-JobVariable <String> ] [-LibraryResource <CustomResource> ] [-PROTipID <Guid]> ] [-RunAsAccount <VMMCredential> ] [-RunAsynchronously] [-ScriptCommandSetting <SCScriptCommandSetting> ] [-ScriptType <ScriptCommandType> {PreService | PostService | SaveState | RestoreState | PreInstall | PostInstall | PreUninstall | PostUninstall | OrderedCommand | OnProvisionFirst | OnProvisionRest | OnDeleteLast | OnDeleteRest | Install} ] [-StandardInput <String> ] [-TimeoutSeconds <Int32> ] [ <CommonParameters>]

詳細説明

The Set-SCScriptCommand cmdlet configures a script command.

パラメーター

-CommandParameters<String>

Specifies the parameters for a script or executable program.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DeploymentOrder<Int32]>

Specifies the order in which a computer tier, application host, or application is deployed.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Executable<String>

Specifies the name of an executable program.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-LibraryResource<CustomResource>

Specifies a resource stored in the VMM library.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-RunAsAccount<VMMCredential>

Specifies a Run As account that contains credentials with permission to perform this action.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ScriptCommand<SCScriptCommand>

Specifies a script command object.

エイリアス

none

必須?

true

位置は?

1

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-ScriptCommandSetting<SCScriptCommandSetting>

Specifies a script command setting object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ScriptType<ScriptCommandType>

Specifies a script type. Valid values are:

-- PreInstall
-- PostInstall
-- SaveState
-- RestoreState
-- PreService
-- PostService
-- PreUninstall
-- PostUninstall

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-StandardInput<String>

Specifies a path to a file that contains standard input information to use with the script command.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-TimeoutSeconds<Int32>

Specifies the amount of time, in seconds, that a process waits before timing out.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • ScriptCommand

Example 1: Add a custom resource to a script command

The first command gets the application profile object named SvcWebAppProfile01, and then stores the object in the $AppProfile variable.

The second command gets the script command object named PreInstall, and then stores the object in the $ScriptCommand variable.

The third command gets the resource object named CustomResource, and then stores the object in the $Resource variable.

The last command adds the resource object stored in $Resource to the script command object stored in $ScriptCommand.

PS C:\> $AppProfile = Get-SCApplicationProfile -Name "SvcWebAppProfile01"
PS C:\> $ScriptCommand = Get-SCScriptCommand -ApplicationProfile $AppProfile | Where {$_.Name -eq "PreInstall"}
PS C:\> $Resource = Get-SCCustomResource -Name "CustomResource.cr"
PS C:\> Set-SCScriptCommand -ScriptCommand $ScriptCommand -LibraryResource $Resource

関連トピック

Add-SCScriptCommand

Get-SCScriptCommand

Remove-SCScriptCommand

Get-SCApplicationProfile

Get-SCCustomResource