Open
Description
Description
Invoke-AzCostManagementQuery
from Az.Billing
v2.2.0 adds two empty lines to terminal before showing the output. This even happens if assigning output to a variable.
This messes up script output.
Expected behavior (no empty lines):
PS > $ConsumptionLastWeek = $(
Invoke-AzCostManagementQuery -DatasetAggregation @{
'totalCost' = @{
'name' = [string] 'Cost'
'function' = [string] 'SUM'
}
} -Type 'ActualCost' -Timeframe 'Custom' `
-Scope ('/subscriptions/{0}' -f $Subscription.'Id') `
-TimePeriodFrom $EndOfTwoWeeksAgo.ToString('o') `
-TimePeriodTo $EndOfLastWeek.ToString('o')
)
PS >
Actual behavior (two empty lines):
PS > $ConsumptionLastWeek = $(
Invoke-AzCostManagementQuery -DatasetAggregation @{
'totalCost' = @{
'name' = [string] 'Cost'
'function' = [string] 'SUM'
}
} -Type 'ActualCost' -Timeframe 'Custom' `
-Scope ('/subscriptions/{0}' -f $Subscription.'Id') `
-TimePeriodFrom $EndOfTwoWeeksAgo.ToString('o') `
-TimePeriodTo $EndOfLastWeek.ToString('o')
)
PS >
Issue script & Debug output
There are no errors.
Environment data
Windows 11 24H2 x64
PowerShell v7.5.0 x64
Az.Billing v2.2.0
Module versions
Az.Billing v2.2.0
Error output
There are no errors.