Redigera

Dela via


Remove-AzTemplateSpec

Removes a Template Spec

Syntax

Remove-AzTemplateSpec
      [-Force]
      [-ResourceGroupName] <String>
      [-Name] <String>
      [[-Version] <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzTemplateSpec
      [-Force]
      [[-Version] <String>]
      [-ResourceId] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Removes a specified Template Spec. If the version -Version parameter is provided, only the specified version will be removed. If no specific version is provided, the Template Spec and all of its versions will be removed. If the -Force flag is present there will be no confirmation prompt for removal.

Examples

Example 1: Removing a specific version by name

Remove-AzTemplateSpec -ResourceGroupName 'myRG' -Name 'MyTemplateSpec' -Version 'v1.0'

Removes version 'v1.0' of the Template Spec named 'MyTemplateSpec' within the resource group 'myRG'.

Example 2: Removing a specific version by resource id

Remove-AzTemplateSpec -ResourceId '/subscriptions/{subId}/resourceGroups/myRG/providers/Microsoft.Resources/templateSpecs/MyTemplateSpec' -Version 'v1.0'

Removes version 'v1.0' of the Template Spec named 'MyTemplateSpec' within the resource group 'myRG' of subscription {subId}.

Example 3: Removing a Template Spec and all versions by name

Remove-AzTemplateSpec -ResourceGroupName 'myRG' -Name 'MyTemplateSpec'

Removes the Template Spec named 'MyTemplateSpec' and all of its versions within the resource group 'myRG'.

Example 4: Removing a Template Spec and all versions by resource id

Remove-AzTemplateSpec -ResourceId '/subscriptions/{subId}/resourceGroups/myRG/providers/Microsoft.Resources/templateSpecs/MyTemplateSpec'

Removes the Template Spec named 'MyTemplateSpec' and all of its versions within the resource group 'myRG' of subscription {subId}.

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

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

-Name

The name of the template spec.

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

-ResourceGroupName

The name of the template spec's resource group.

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

-ResourceId

The fully qualified resource Id of the template spec. Example: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}

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

-Version

The version of the template spec to delete.

Type:String
Position:2
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

String

Outputs

Boolean