Skip to content

Latest commit

 

History

History
200 lines (153 loc) · 5.06 KB

Remove-AzTemplateSpec.md

File metadata and controls

200 lines (153 loc) · 5.06 KB
external help file Module Name online version schema
Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.dll-Help.xml
Az.Resources
2.0.0

Remove-AzTemplateSpec

SYNOPSIS

Removes a Template Spec

SYNTAX

RemoveByNameParameterSet (Default)

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

RemoveByIdParameterSet

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

-DefaultProfile

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

Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential

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

-Force

Do not ask for confirmation.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Name

The name of the template spec.

Type: System.String
Parameter Sets: RemoveByNameParameterSet
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ResourceGroupName

The name of the template spec's resource group.

Type: System.String
Parameter Sets: RemoveByNameParameterSet
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
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: System.String
Parameter Sets: RemoveByIdParameterSet
Aliases: Id

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Version

The version of the template spec to delete.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
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: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

CommonParameters

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

INPUTS

System.String

OUTPUTS

System.Boolean

NOTES

RELATED LINKS