Remove-SCScriptCommand

Deletes a script command from an application profile, application deployment, or host profile.

Description

The Remove-SCScriptCommand deletes a script command from an application profile, application deployment, or host profile.

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

Parameters

ScriptCommand

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

Force

Required? false
Accept Pipeline Input? false
Position? named
Forces the operation to complete. 

For example:
- Remove-SCSCVMHost -Force
  Forces the removal of a host object from the VMM database.

- Stop-SCVirtualMachine -Force
  Stops a virtual machine.

JobVariable

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

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.

RunAsynchronously

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

Examples

1: Remove all script commands associated with a specific application profile.
PS C:\> $AppProfile = Get-SCApplicationProfile -Name "SvcWebAppProfile01"
PS C:\> $ScriptCommand = Get-SCScriptCommand -ApplicationProfile $AppProfile
PS C:\> $ScriptCommand | Remove-SCScriptCommand
The first command gets the application profile object named SvcWebAppProfile01 and stores the object in the $AppProfile variable.

The second command gets all script command objects for the application profile stored in $AppProfile and stores the objects in the $ScriptCommand array.

The last command uses the pipeline operator to pass each application profile stored in the $ScriptCommand array to Remove-SCScriptCommand which removes the script command object from application pfofile SvcWebAppProfile01.

See Also