Set-SCScriptCommand

Configures a script command.

Description

The Set-SCScriptCommand cmdlet configures a script command.

For more information about Set-SCriptCommand, type: "Get-Help Set-SCScriptCommand -online".

Parameters

ScriptCommand

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a script command object.

CommandParameters

Required? false
Accept Pipeline Input? false
Position? named
Specifies the parameters for a script or executable program.

Executable

Required? false
Accept Pipeline Input? false
Position? named
Specifies the name of an executable program.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

LibraryResource

Required? false
Accept Pipeline Input? false
Position? named
Specifies a resource stored in the VMM library.

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsAccount

Required? false
Accept Pipeline Input? false
Position? named
Specifies a Run As account that contains credentials with permission to perform this action.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

ScriptCommandSetting

Required? false
Accept Pipeline Input? false
Position? named
Specifies a script command setting object.

ScriptType

Required? false
Accept Pipeline Input? false
Position? named
Specifies a script type. Valid values are: PreInstall, PostInstall, SaveState, RestoreState, PreService, PostService, PreUninstall, PostUninstall.

StandardInput

Required? false
Accept Pipeline Input? false
Position? named
Specifies a path to a file that contains standard input information to use with the script command.

TimeoutSeconds

Required? false
Accept Pipeline Input? false
Position? named
Specifies the amount of time, in seconds, that a process waits before timing out.

Examples

1: Add a custom resource to a script command.
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
The first command gets the application profile object named SvcWebAppProfile01 and stores the object in the $AppProfile variable.

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

The third command gets the resource object named CustomResource and 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.

See Also