使用 powershell 的 Azure 账单信息?

Azure billing information with powershell?

是否有任何方法可以使用 powershell 获取特定资源组的账单信息(花费的时间和金钱)?

您可以使用 Microsoft Azure Powershell Get-UsageAggregates cmdlet 获取账单信息。

有关如何使用此 Cmdlet 的示例,请参阅此博客 post:http://blogs.technet.com/b/keithmayer/archive/2015/06/30/export-azure-subscription-usage-with-new-billing-api-and-powershell.aspx

首先使用 Login-AzureRmAccount cmdlet,然后使用以下命令获取数据。

Get-UsageAggregates -ReportedStartTime "2016-01-01" -ReportedEndTime "2016-01-07" -AggregationGranularity "Daily" -ShowDetails $true

使用您可以从 RateCard API 获得的上述信息和数据,您也可以得到发生的费用。