Aracılığıyla paylaş


Remove-AzPolicyDefinition

Removes a policy definition.

Sözdizimi

NameParameterSet EnterprisePublishing

Remove-AzPolicyDefinition
    -Name <String>
    [-Force]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ManagementGroupNameParameterSet

Remove-AzPolicyDefinition
    -Name <String>
    -ManagementGroupName <String>
    [-Force]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SubscriptionIdParameterSet

Remove-AzPolicyDefinition
    -Name <String>
    -SubscriptionId <Guid>
    [-Force]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

IdParameterSet

Remove-AzPolicyDefinition
    -Id <String>
    [-Force]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-AzPolicyDefinition cmdlet removes a policy definition.

Örnekler

Example 1: Remove the policy definition by name

PS C:\> Remove-AzPolicyDefinition -Name 'VMPolicyDefinition'

This command removes the specified policy definition.

Example 2: Remove policy definition by resource ID

PS C:\> $PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition'
PS C:\> Remove-AzPolicyDefinition -Id $PolicyDefinition.ResourceId -Force

The first command gets a policy definition named VMPolicyDefinition by using the Get-AzPolicyDefinition cmdlet. The command stores it in the $PolicyDefinition variable. The second command removes the policy definition identified by the ResourceId property of $PolicyDefinition.

Parametreler

-ApiVersion

Specifies the version of the resource provider API to use. If you do not specify a version, this cmdlet uses the latest available version.

Parametre özellikleri

Tür:String
Default value:None
Joker karakterleri destekler:False
DontShow:False

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parametre özellikleri

Tür:SwitchParameter
Default value:False
Joker karakterleri destekler:False
DontShow:False
Diğer adlar:cf

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

-DefaultProfile

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

Parametre özellikleri

Tür:IAzureContextContainer
Default value:None
Joker karakterleri destekler:False
DontShow:False
Diğer adlar:AzContext, AzureCredential

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

-Force

Forces the command to run without asking for user confirmation.

Parametre özellikleri

Tür:SwitchParameter
Default value:None
Joker karakterleri destekler:False
DontShow:False

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

-Id

Specifies the fully qualified resource ID for the policy definition that this cmdlet removes.

Parametre özellikleri

Tür:String
Default value:None
Joker karakterleri destekler:False
DontShow:False
Diğer adlar:ResourceId

Parametre kümeleri

IdParameterSet
Position:Named
Zorunlu:True
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:True
Kalan argümanlardan elde edilen değer:False

-InformationAction

Specifies how this cmdlet responds to an information event. The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend

Parametre özellikleri

Tür:ActionPreference
Default value:None
Joker karakterleri destekler:False
DontShow:False
Diğer adlar:infa

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

-InformationVariable

Specifies an information variable.

Parametre özellikleri

Tür:String
Default value:None
Joker karakterleri destekler:False
DontShow:False
Diğer adlar:iv

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

-ManagementGroupName

The name of the management group of the policy definition to delete.

Parametre özellikleri

Tür:String
Default value:None
Joker karakterleri destekler:False
DontShow:False

Parametre kümeleri

ManagementGroupNameParameterSet
Position:Named
Zorunlu:True
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:True
Kalan argümanlardan elde edilen değer:False

-Name

Specifies the name of the policy definition that this cmdlet removes.

Parametre özellikleri

Tür:String
Default value:None
Joker karakterleri destekler:False
DontShow:False

Parametre kümeleri

NameParameterSet
Position:Named
Zorunlu:True
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:True
Kalan argümanlardan elde edilen değer:False

-Pre

Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.

Parametre özellikleri

Tür:SwitchParameter
Default value:None
Joker karakterleri destekler:False
DontShow:False

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

-SubscriptionId

The subscription ID of the policy definition to delete.

Parametre özellikleri

Tür:

Nullable<T>[Guid]

Default value:None
Joker karakterleri destekler:False
DontShow:False

Parametre kümeleri

SubscriptionIdParameterSet
Position:Named
Zorunlu:True
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:True
Kalan argümanlardan elde edilen değer:False

-WhatIf

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

Parametre özellikleri

Tür:SwitchParameter
Default value:False
Joker karakterleri destekler:False
DontShow:False
Diğer adlar:wi

Parametre kümeleri

(All)
Position:Named
Zorunlu:False
İşlem hattından gelen değer:False
İşlem hattından özellik adına göre değer:False
Kalan argümanlardan elde edilen değer:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.