@@ -20,7 +20,7 @@ Query the usage data for scope defined.
2020Query the usage data for scope defined.
2121#>
2222function Invoke-AzCostManagementQuery {
23- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. IQueryResult ])]
23+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult ])]
2424[CmdletBinding (DefaultParameterSetName = ' UsageExpanded' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
2525param (
2626 [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.")]
@@ -37,27 +37,27 @@ param(
3737 ${ExternalCloudProviderId} ,
3838
3939 [Parameter (ParameterSetName = ' UsageExpanded1' , Mandatory , HelpMessage = " The external cloud provider type associated with dimension/query operations." )]
40- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType ] )]
40+ [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute ( " ExternalBillingAccounts " , " ExternalSubscriptions " )]
4141 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category (' Path' )]
42- [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType ]
42+ [System.String ]
4343 # The external cloud provider type associated with dimension/query operations.
4444 # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.
4545 ${ExternalCloudProviderType} ,
4646
4747 [Parameter (ParameterSetName = ' UsageExpanded' , Mandatory , HelpMessage = " The time frame for pulling data for the query." )]
4848 [Parameter (ParameterSetName = ' UsageExpanded1' , Mandatory , HelpMessage = " The time frame for pulling data for the query." )]
49- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType ] )]
49+ [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute ( " MonthToDate " , " BillingMonthToDate " , " TheLastMonth " , " TheLastBillingMonth " , " WeekToDate " , " Custom " )]
5050 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category (' Body' )]
51- [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType ]
51+ [System.String ]
5252 # The time frame for pulling data for the query.
5353 # If custom, then a specific time period must be provided.
5454 ${Timeframe} ,
5555
5656 [Parameter (ParameterSetName = ' UsageExpanded' , Mandatory , HelpMessage = " The type of the query." )]
5757 [Parameter (ParameterSetName = ' UsageExpanded1' , Mandatory , HelpMessage = " The type of the query." )]
58- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType ] )]
58+ [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute ( " Usage " , " ActualCost " , " AmortizedCost " )]
5959 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category (' Body' )]
60- [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType ]
60+ [System.String ]
6161 # The type of the query.
6262 ${Type} ,
6363
7373 [Parameter (ParameterSetName = ' UsageExpanded' , HelpMessage = " Dictionary of aggregation expression to use in the query." )]
7474 [Parameter (ParameterSetName = ' UsageExpanded1' , HelpMessage = " Dictionary of aggregation expression to use in the query." )]
7575 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category (' Body' )]
76- [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info (PossibleTypes= ([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. IQueryDatasetAggregation ]))]
76+ [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info (PossibleTypes= ([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation ]))]
7777 [System.Collections.Hashtable ]
7878 # Dictionary of aggregation expression to use in the query.
7979 # The key of each item in the dictionary is the alias for the aggregated column.
@@ -83,23 +83,23 @@ param(
8383 [Parameter (ParameterSetName = ' UsageExpanded' , HelpMessage = " Has filter expression to use in the query." )]
8484 [Parameter (ParameterSetName = ' UsageExpanded1' , HelpMessage = " Has filter expression to use in the query." )]
8585 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category (' Body' )]
86- [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. IQueryFilter ]
86+ [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter ]
8787 # Has filter expression to use in the query.
8888 # To construct, see NOTES section for DATASETFILTER properties and create a hash table.
8989 ${DatasetFilter} ,
9090
9191 [Parameter (ParameterSetName = ' UsageExpanded' , HelpMessage = " The granularity of rows in the query." )]
9292 [Parameter (ParameterSetName = ' UsageExpanded1' , HelpMessage = " The granularity of rows in the query." )]
93- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType ] )]
93+ [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute ( " Daily " )]
9494 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category (' Body' )]
95- [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType ]
95+ [System.String ]
9696 # The granularity of rows in the query.
9797 ${DatasetGranularity} ,
9898
9999 [Parameter (ParameterSetName = ' UsageExpanded' , HelpMessage = ' Array of group by expression to use in the query.' )]
100100 [Parameter (ParameterSetName = ' UsageExpanded1' , HelpMessage = " Array of group by expression to use in the query." )]
101101 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category (' Body' )]
102- [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. IQueryGrouping []]
102+ [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping []]
103103 # Array of group by expression to use in the query.
104104 # Query can have up to 2 group by clauses.
105105 # To construct, see NOTES section for DATASETGROUPING properties and create a hash table.
@@ -178,7 +178,7 @@ param(
178178 " $Scope /providers/Microsoft.CostManagement/query?api-version=$ApiVersion " , " \\?&*$|&*$|(\\?)&+|(&)&+" , " $1$2 " )
179179 }
180180
181- $Request = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. QueryDefinition ]::New()
181+ $Request = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDefinition ]::New()
182182 if ($PSBoundParameters.ContainsKey (' ConfigurationColumn' )) {
183183 $Request.ConfigurationColumn = $ConfigurationColumn
184184 }
@@ -206,7 +206,7 @@ param(
206206 if ($PSBoundParameters.ContainsKey (' Type' )) {
207207 $Request.Type = $Type
208208 }
209- $Result = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. QueryResult ]::New()
209+ $Result = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult ]::New()
210210 $SkipToken = $null
211211 $RowList = New-Object System.Collections.Generic.List[System.Collections.Generic.List [string ]]
212212 while ($true ) {
@@ -228,7 +228,7 @@ param(
228228}
229229
230230function Invoke-AzCostManagementUsageQueryInternal {
231- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. IQueryResult ])]
231+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult ])]
232232 param (
233233 [System.String ]
234234 ${URL} ,
@@ -245,16 +245,16 @@ function Invoke-AzCostManagementUsageQueryInternal {
245245 }
246246 $ResponseContent = (Invoke-AzRest - Path $URL - Payload $Payload - Method POST).Content | ConvertFrom-Json
247247
248- $Result = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. QueryResult ]::New()
248+ $Result = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult ]::New()
249249 if ($null -ne $ResponseContent.Properties.NextLink )
250250 {
251251 $Result.NextLink = $ResponseContent.Properties.NextLink.split (' &' )[1 ]
252252 }
253253
254- $ColumnList = New-Object System.Collections.Generic.List[Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. IQueryColumn ]
254+ $ColumnList = New-Object System.Collections.Generic.List[Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn ]
255255 foreach ($Column in $ResponseContent.Properties.Columns ) {
256256 Write-Host $Column.ToString ()
257- $QueryColumn = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001. QueryColumn ]::New()
257+ $QueryColumn = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumn ]::New()
258258 $QueryColumn.Name = $Column.Name
259259 $QueryColumn.Type = $Column.Type
260260 $ColumnList.Add ($QueryColumn )
0 commit comments