Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Remove-AzManagementGroupDeployment

Removes a deployment at a management group and any associated operations

Syntax

RemoveByDeploymentName (Default)

Remove-AzManagementGroupDeployment
 [-ManagementGroupId] <String>
 [-Name] <String>
 [-AsJob]
 [-PassThru]
 [-Pre]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

RemoveByDeploymentId

Remove-AzManagementGroupDeployment
 -Id <String>
 [-AsJob]
 [-PassThru]
 [-Pre]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

RemoveByInputObject

Remove-AzManagementGroupDeployment
 -InputObject <PSDeployment>
 [-AsJob]
 [-PassThru]
 [-Pre]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

The Remove-AzManagementGroupDeployment cmdlet removes an Azure deployment at a management group and any associated operations.

Examples

Example 1: Remove a deployment with a given name

Remove-AzManagementGroupDeployment -ManagementGroupId "myMG" -Name "RolesDeployment"

This command removes the deployment "RolesDeployment" at the management group "myMG".

Example 2: Get a deployment and remove it

Get-AzManagementGroupDeployment -ManagementGroupId "myMG" -Name "RolesDeployment" | Remove-AzManagementGroupDeployment

This command gets the deployment "RolesDeployment" at the management group "myMG" and removes it.

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-Id

The fully qualified resource Id of the deployment. example: /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deployments/{deploymentName}

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DeploymentId, ResourceId

Parameter sets

-InputObject

The deployment object.

Parameter properties

Type:PSDeployment
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ManagementGroupId

The management group id.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Name

The name of the deployment.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DeploymentName

Parameter sets

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Pre

When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSDeployment

Outputs

Boolean


Feedback

Was this page helpful?