Remove-AzResourceGroup
Removes a resource group.
Remove-AzResourceGroup
[-Name] <String>
[-ForceDeletionType <String>]
[-Force]
[-AsJob]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzResourceGroup
-Id <String>
[-ForceDeletionType <String>]
[-Force]
[-AsJob]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Remove-AzResourceGroup cmdlet removes an Azure resource group and its resources from the current subscription. To delete a resource, but leave the resource group, use the Remove-AzResource cmdlet.
Remove-AzResourceGroup -Name "ContosoRG01"
This command removes the ContosoRG01 resource group from the subscription. The cmdlet prompts you for confirmation and returns no output.
Get-AzResourceGroup -Name "ContosoRG01" | Remove-AzResourceGroup -Force
This command uses the Get-AzResourceGroup cmdlet to get the resource group ContosoRG01, and then passes it to Remove-AzResourceGroup by using the pipeline operator. The Force parameter suppresses the confirmation prompt.
Get-AzResourceGroup | Remove-AzResourceGroup
This command uses the Get-AzResourceGroup cmdlet to get all resource groups, and then passes them to Remove-AzResourceGroup by using the pipeline operator.
Remove-AzResourceGroup -Name "ContosoRG01" -ForceDeletionType "Microsoft.Compute/virtualMachineScaleSets,Microsoft.Compute/virtualMachines,Microsoft.Databricks/workspaces"
This command removes the ContosoRG01 resource group use the ForceDeletionType. The cmdlet prompts you for confirmation and returns no output.
Specifies the API version that is supported by the resource Provider. You can specify a different version than the default version.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Run cmdlet in the background
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The resource types you want to force delete.Currently, only the following is supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the ID of resource group to remove. Wildcard characters are not permitted.
Type: | String |
Aliases: | ResourceGroupId, ResourceId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the names of resource groups to remove. Wildcard characters are not permitted.
Type: | String |
Aliases: | ResourceGroupName |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Feedback su Azure PowerShell
Azure PowerShell è un progetto di open source. Selezionare un collegamento per fornire feedback: