你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Remove-AzManagementGroupDeploymentStack

Removes a Management Group scoped Deployment Stack.

Syntax

Remove-AzManagementGroupDeploymentStack
      [-Name] <String>
      [-ManagementGroupId] <String>
      -ActionOnUnmanage <PSActionOnUnmanage>
      [-PassThru]
      [-Force]
      [-BypassStackOutOfSyncError]
      [-Pre]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzManagementGroupDeploymentStack
      -ResourceId <String>
      -ActionOnUnmanage <PSActionOnUnmanage>
      [-PassThru]
      [-Force]
      [-BypassStackOutOfSyncError]
      [-Pre]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzManagementGroupDeploymentStack
      [-InputObjet] <PSDeploymentStack>
      -ActionOnUnmanage <PSActionOnUnmanage>
      [-PassThru]
      [-Force]
      [-BypassStackOutOfSyncError]
      [-Pre]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Delete a management group scoped deployment stack.

Examples

Example 1: Deletes the management group scoped stack MyMGStack from MyManagementGroup

Remove-AzManagementGroupDeploymentStack -ManagementGroupId MyManagementGroup -Name MyMGStack

Deletes a management group scoped deployment stack named 'MyMGStack' in management group 'MyManagementGroup,' with unmanaged resources and resource groups being detached on cleanup.

Parameters

-ActionOnUnmanage

Action to take on resources that become unmanaged on deletion or update of the deployment stack. Possible values include: 'detachAll' (do not delete any unmanaged resources), 'deleteResources' (delete all unmanaged resources that are not RGs or MGs), and 'deleteAll' (delete every unmanaged resource).

Type:PSActionOnUnmanage
Accepted values:DetachAll, DeleteResources, DeleteAll
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-BypassStackOutOfSyncError

Bypass errors for the stack being out of sync when running the operation. If the stack is out of sync and this parameter is not set, the operation will fail. Only include this parameter if instructed to do so on a failed stack operation.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Do not ask for confirmation.

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

-InputObjet

The stack PS object

Type:PSDeploymentStack
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ManagementGroupId

The id of the ManagementGroup where the DeploymentStack is being deleted

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

The name of the DeploymentStack to delete

Type:String
Aliases:StackName
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PassThru

If set, a boolean will be returned with value dependent on cmdlet success.

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

-Pre

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

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

-ResourceId

ResourceId of the DeploymentStack to delete

Type:String
Aliases:Id
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

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

Inputs

String

Outputs

Boolean