Remove-AzKeyVaultManagedHsm

Deletes/Purges a managed HSM.

Syntax

Remove-AzKeyVaultManagedHsm
      [-Name] <String>
      [[-ResourceGroupName] <String>]
      [-Force]
      [-AsJob]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [-SubscriptionId <String>]
      [<CommonParameters>]
Remove-AzKeyVaultManagedHsm
      [-Name] <String>
      [-Location] <String>
      [-InRemovedState]
      [-Force]
      [-AsJob]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [-SubscriptionId <String>]
      [<CommonParameters>]
Remove-AzKeyVaultManagedHsm
      [-InputObject] <PSManagedHsm>
      [-Force]
      [-AsJob]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [-SubscriptionId <String>]
      [<CommonParameters>]
Remove-AzKeyVaultManagedHsm
      [-InputObject] <PSManagedHsm>
      [-InRemovedState]
      [-Force]
      [-AsJob]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [-SubscriptionId <String>]
      [<CommonParameters>]
Remove-AzKeyVaultManagedHsm
      [-ResourceId] <String>
      [-Force]
      [-AsJob]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [-SubscriptionId <String>]
      [<CommonParameters>]
Remove-AzKeyVaultManagedHsm
      [-ResourceId] <String>
      [-Location] <String>
      [-InRemovedState]
      [-Force]
      [-AsJob]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [-SubscriptionId <String>]
      [<CommonParameters>]

Description

The Remove-AzKeyVaultManagedHsm cmdlet deletes the specified managed HSM. It also deletes all keys contained in that instance. Note that although specifying the resource group is optional for this cmdlet, you should so for better performance.

Examples

Example 1: Remove a managed HSM

Remove-AzKeyVaultManagedHsm -HsmName 'myhsm' -Force

True

This command removes the managed HSM named myhsm from your current subscription.

Example 2: Remove a managed hsm from a specified resource group

Remove-AzKeyVaultManagedHsm -HsmName 'myhsm' -ResourceGroupName "myrg1" -PassThru

True

This command removes the managed HSM named myhsm from the resource group named myrg1. If you do not specify the resource group name, the cmdlet searches for the named managed HSM to delete in your current subscription.

Example 3: Purge a deleted managed hsm

Remove-AzKeyVaultManagedHsm -Name 'myhsm' -Location "eastus" -Force -PassThru

True

This command purges the managed HSM named myhsm located at eastus.

Parameters

-AsJob

Run cmdlet in the background

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

Indicates that the cmdlet does not prompt you for confirmation. By default, this cmdlet prompts you to confirm that you want to delete the managed HSM.

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

-InputObject

Managed HSM object to be deleted.

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

-InRemovedState

Remove the previously deleted managed HSM pool permanently.

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

-Location

The location of the deleted managed HSM pool.

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

-Name

Specifies the name of the managed HSM to remove.

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

-PassThru

This Cmdlet does not return an object by default. If this switch is specified, it returns true if successful.

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

-ResourceGroupName

Specifies the name of resource group for Azure managed HSM to remove.

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

-ResourceId

ManagedHsm Resource Id.

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

-SubscriptionId

The ID of the subscription. By default, cmdlets are executed in the subscription that is set in the current context. If the user specifies another subscription, the current cmdlet is executed in the subscription specified by the user. Overriding subscriptions only take effect during the lifecycle of the current cmdlet. It does not change the subscription in the context, and does not affect subsequent cmdlets.

Type:String
Position:Named
Default value:None
Required:False
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

PSManagedHsm

String

Outputs

Boolean