Editar

Compartilhar via


Remove-AzKeyVaultRoleDefinition

Removes a custom role definition from an HSM.

Syntax

Remove-AzKeyVaultRoleDefinition
      [-HsmName] <String>
      [-Scope <String>]
      -RoleName <String>
      [-Force]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzKeyVaultRoleDefinition
      [-HsmName] <String>
      [-Scope <String>]
      -InputObject <PSKeyVaultRoleDefinition>
      [-Force]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-AzKeyVaultRoleDefinition cmdlet deletes a custom role in Azure Role-Based Access Control of Azure KeyVault managed HSM. Provide the -RoleName parameter of an existing custom role or a role object to delete that custom role. By default, Remove-AzKeyVaultRoleDefinition prompts you for confirmation. To suppress the prompt, use the -Force parameter.

Examples

Example 1

Remove-AzKeyVaultRoleDefinition -HsmName myHsm -RoleName "my role"

This example removes a custom role named "my role".

Example 2

$role = Get-AzKeyVaultRoleDefinition -HsmName myHsm -RoleName "my role"
$role | Remove-AzKeyVaultRoleDefinition -HsmName myHsm -Force

This example removes a custom role named "my role" by piping the role object. It also suppress the prompt by -Force.

Parameters

-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 confirm.

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

-HsmName

Name of the HSM.

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

-InputObject

The object representing the role definition to be removed.

Type:PSKeyVaultRoleDefinition
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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

-RoleName

Name of the role definition to get.

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

-Scope

Scope at which the role assignment or definition applies to, e.g., '/' or '/keys' or '/keys/{keyName}'.

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

Inputs

PSKeyVaultRoleDefinition

Outputs

Boolean