共用方式為


Remove-AzConsumptionBudget

拿掉訂用帳戶或資源群組中的預算。

語法

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

Description

Remove-AzConsumptionBudget Cmdlet 會移除訂用帳戶或資源群組中的預算。

範例

範例 1:移除訂用帳戶層級預算名稱的預算

Remove-AzConsumptionBudget -Name PSBudget -PassThru

True

範例 2:移除具有資源群組層級預算名稱的預算

Remove-AzConsumptionBudget -ResourceGroupName RGBudgets -Name PSBudgetRG -PassThru

True

範例 3:透過訂用帳戶層級的管線移除預算

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

True

參數

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InputObject

Budget 物件。

類型:PSBudget
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Name

預算的名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-PassThru

如果已成功移除預算,Cmdlet 會傳回 true。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

預算的資源群組。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

PSBudget

輸出

Boolean

備註

  • 目前,PowerShell SDK for Consumption 僅適用於 Enterprise 合約客戶。
  • PowerShell SDK for Consumption 是使用舊版的 Budgets API,而很少有回溯不相容的專案,例如列出具有篩選條件的預算將無法如預期般運作。