Edit

Share via


Remove-AzConsumptionBudget

Remove a budget in either a subscription or a resource group.

Syntax

Subscription (Default)

Remove-AzConsumptionBudget
    -Name <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-ResourceGroupName <String>]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Piping

Remove-AzConsumptionBudget
    -InputObject <PSBudget>
    [-DefaultProfile <IAzureContextContainer>]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-AzConsumptionBudget cmdlet removes a budget in either a subscription or a resource group.

Examples

Example 1: Remove a budget with a budget name at subscription level

Remove-AzConsumptionBudget -Name PSBudget -PassThru
True

Example 2: Remove a budget with a budget name at resource group level

Remove-AzConsumptionBudget -ResourceGroupName RGBudgets -Name PSBudgetRG -PassThru
True

Example 3: Remove a budget through piping at subscription level

Get-AzConsumptionBudget -Name PSBudget | Remove-AzConsumptionBudget -PassThru
True

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Budget object.

Parameter properties

Type:PSBudget
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Piping
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Name of a budget.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Subscription
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

The Cmdlet returns true if a budget was successfully removed.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

Resource Group of a budget.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Subscription
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Inputs

PSBudget

Outputs

Boolean

Notes

  • Currently, PowerShell SDK for Consumption is only available to Enterprise Agreement customers.
  • PowerShell SDK for Consumption is using an older version of Budgets API and few backwards non-compatible items like listing Budgets with filters will not work as expected.