Remove-AzRmStorageContainerLegalHold

Removes legal hold tags from a Storage blob container

Syntax

Remove-AzRmStorageContainerLegalHold
      [-ResourceGroupName] <String>
      [-StorageAccountName] <String>
      -Name <String>
      -Tag <String[]>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzRmStorageContainerLegalHold
      -Name <String>
      -StorageAccount <PSStorageAccount>
      -Tag <String[]>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzRmStorageContainerLegalHold
      -Container <PSContainer>
      -Tag <String[]>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-AzRmStorageContainerLegalHold cmdlet removes legal hold tags from a Storage blob container

Examples

Example 1: Remove legal hold tags from a Storage blob container with Storage account name and container name

PS C:\>Remove-AzRmStorageContainerLegalHold -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Tag  tag1

This command removes legal hold tags from a Storage blob container with Storage account name and container name.

Example 2: Remove legal hold tags from a Storage blob container with Storage account object and container name

PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount"
PS C:\>Remove-AzRmStorageContainerLegalHold -StorageAccount $accountObject -ContainerName "myContainer"  -Tag  tag1,tag2

This command removes legal hold tags from a Storage blob container with Storage account object and container name.

Example 3: Remove legal hold tags from all Storage blob containers in a Storage account with pipeline

PS C:\>Get-AzStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Remove-AzRmStorageContainerLegalHold -Tag  tag1

This command removes legal hold tags from all Storage blob containers in a Storage account with pipeline.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

Storage container object

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSContainer
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Container Name

Type:String
Aliases:N, ContainerName
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-ResourceGroupName

Resource Group Name.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StorageAccount

Storage account object

Type:PSStorageAccount
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-StorageAccountName

Storage Account Name.

Type:String
Aliases:AccountName
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Tag

Container LegalHold Tags

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:False
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSStorageAccount

Microsoft.Azure.Commands.Management.Storage.Models.PSContainer

Outputs

Microsoft.Azure.Commands.Management.Storage.Models.PSLegalHold