Remove-SCScriptCommand

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

Syntax

Remove-SCScriptCommand [-Confirm] [-Force] [-JobGroup <Guid>] [-JobVariable <String>] [-PROTipID <Guid>]
 [-RunAsynchronously] -ScriptCommand <SCScriptCommand> [-WhatIf] [<CommonParameters>]

Description

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

Examples

Example 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 the application profile SvcWebAppProfile01.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobGroup

Specifies an ID for a series of commands that runs as a set just before the final command that includes the same job group ID runs.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

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

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

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

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ScriptCommand

Specifies a script command object.

Type:SCScriptCommand
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False