Skip to content

Commit f7f6764

Browse files
azure-pipelines[bot]azure-powershell-botVeryEarly
authored
Migrate CostManagement from generation to main (#25998)
* Move CostManagement to main * Update ChangeLog.md --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Yabo Hu <[email protected]>
1 parent 827001c commit f7f6764

15 files changed

+208
-28
lines changed

src/CostManagement/CostManagement.Autorest/build-module.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
15+
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks)
1616
$ErrorActionPreference = 'Stop'
1717

1818
if($PSEdition -ne 'Core') {
@@ -169,4 +169,14 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
169169
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
170170
}
171171

172+
if (-not $DisableAfterBuildTasks){
173+
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
174+
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
175+
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
176+
Write-Host -ForegroundColor Green 'Running after build tasks...'
177+
. $afterBuildTasksPath @afterBuildTasksArgs
178+
}
179+
}
180+
181+
172182
Write-Host -ForegroundColor Green '-------------Done-------------'

src/CostManagement/CostManagement.Autorest/custom/Invoke-AzCostManagementQuery.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ function Invoke-AzCostManagementUsageQueryInternal {
265265
foreach ($Row in $ResponseContent.Properties.Rows) {
266266
$QueryRow = New-Object System.Collections.Generic.List[string]
267267
foreach ($Item in $Row) {
268-
$QueryRow.Add($Item.ToString())
268+
if ($null -eq $Item) {
269+
$QueryRow.Add($Item)
270+
} else {
271+
$QueryRow.Add($Item.ToString())
272+
}
269273
}
270274
$RowList.Add($QueryRow)
271275
}

src/CostManagement/CostManagement/Az.CostManagement.psd1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 23/04/2024
6+
# Generated on: 9/3/2024
77
#
88

99
@{
@@ -51,19 +51,19 @@ DotNetFrameworkVersion = '4.7.2'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.19.0'; })
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '3.0.4'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = 'CostManagement.Autorest/bin/Az.CostManagement.private.dll'
5858

5959
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
60+
ScriptsToProcess = @()
6161

6262
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
63+
TypesToProcess = @()
6464

6565
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = 'CostManagement.Autorest\Az.CostManagement.format.ps1xml'
66+
FormatsToProcess = 'CostManagement.Autorest/Az.CostManagement.format.ps1xml'
6767

6868
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
6969
NestedModules = @('CostManagement.Autorest/Az.CostManagement.psm1')
@@ -103,7 +103,7 @@ PrivateData = @{
103103
PSData = @{
104104

105105
# Tags applied to this module. These help with module discovery in online galleries.
106-
Tags = 'Azure','ResourceManager','ARM','PSModule','Cost'
106+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Cost'
107107

108108
# A URL to the license for this module.
109109
LicenseUri = 'https://aka.ms/azps-license'
@@ -128,7 +128,7 @@ PrivateData = @{
128128

129129
} # End of PSData hashtable
130130

131-
} # End of PrivateData hashtable
131+
} # End of PrivateData hashtable
132132

133133
# HelpInfo URI of this module
134134
# HelpInfoURI = ''

src/CostManagement/CostManagement/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fixed an error that values in row could be null when grouping by the value of TagKey in Invoke-AzCostManagementQuery cmdlet. Fix in 0.3.1 accidentally removed from 0.3.2, added it back. [#25948]
2223

2324
## Version 0.3.2
2425
* Introduced secrets detection feature to safeguard sensitive data.

src/CostManagement/CostManagement/help/Get-AzCostManagementExport.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ The operation to get the export for the defined scope by export name.
1515
### List (Default)
1616
```
1717
Get-AzCostManagementExport -Scope <String> [-Expand <String>] [-DefaultProfile <PSObject>]
18-
[<CommonParameters>]
18+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
1919
```
2020

2121
### Get
2222
```
2323
Get-AzCostManagementExport -Name <String> -Scope <String> [-Expand <String>] [-DefaultProfile <PSObject>]
24-
[<CommonParameters>]
24+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
2525
```
2626

2727
### GetViaIdentity
2828
```
2929
Get-AzCostManagementExport -InputObject <ICostManagementIdentity> [-Expand <String>]
30-
[-DefaultProfile <PSObject>] [<CommonParameters>]
30+
[-DefaultProfile <PSObject>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
3131
```
3232

3333
## DESCRIPTION
@@ -128,6 +128,21 @@ Accept pipeline input: False
128128
Accept wildcard characters: False
129129
```
130130
131+
### -ProgressAction
132+
{{ Fill ProgressAction Description }}
133+
134+
```yaml
135+
Type: System.Management.Automation.ActionPreference
136+
Parameter Sets: (All)
137+
Aliases: proga
138+
139+
Required: False
140+
Position: Named
141+
Default value: None
142+
Accept pipeline input: False
143+
Accept wildcard characters: False
144+
```
145+
131146
### -Scope
132147
This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.
133148

src/CostManagement/CostManagement/help/Get-AzCostManagementExportExecutionHistory.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ The operation to get the execution history of an export for the defined scope an
1515
### Get (Default)
1616
```
1717
Get-AzCostManagementExportExecutionHistory -ExportName <String> -Scope <String> [-DefaultProfile <PSObject>]
18-
[<CommonParameters>]
18+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
1919
```
2020

2121
### GetViaIdentity
2222
```
2323
Get-AzCostManagementExportExecutionHistory -InputObject <ICostManagementIdentity> [-DefaultProfile <PSObject>]
24-
[<CommonParameters>]
24+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
2525
```
2626

2727
## DESCRIPTION
@@ -107,6 +107,21 @@ Accept pipeline input: True (ByValue)
107107
Accept wildcard characters: False
108108
```
109109
110+
### -ProgressAction
111+
{{ Fill ProgressAction Description }}
112+
113+
```yaml
114+
Type: System.Management.Automation.ActionPreference
115+
Parameter Sets: (All)
116+
Aliases: proga
117+
118+
Required: False
119+
Position: Named
120+
Default value: None
121+
Accept pipeline input: False
122+
Accept wildcard characters: False
123+
```
124+
110125
### -Scope
111126
This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.
112127

src/CostManagement/CostManagement/help/Invoke-AzCostManagementExecuteExport.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ The operation to execute an export.
1515
### Execute (Default)
1616
```
1717
Invoke-AzCostManagementExecuteExport -ExportName <String> -Scope <String> [-DefaultProfile <PSObject>]
18-
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
18+
[-PassThru] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
1919
```
2020

2121
### ExecuteViaIdentity
2222
```
2323
Invoke-AzCostManagementExecuteExport -InputObject <ICostManagementIdentity> [-DefaultProfile <PSObject>]
24-
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
24+
[-PassThru] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
2525
```
2626

2727
## DESCRIPTION
@@ -108,6 +108,21 @@ Accept pipeline input: False
108108
Accept wildcard characters: False
109109
```
110110
111+
### -ProgressAction
112+
{{ Fill ProgressAction Description }}
113+
114+
```yaml
115+
Type: System.Management.Automation.ActionPreference
116+
Parameter Sets: (All)
117+
Aliases: proga
118+
119+
Required: False
120+
Position: Named
121+
Default value: None
122+
Accept pipeline input: False
123+
Accept wildcard characters: False
124+
```
125+
111126
### -Scope
112127
This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.
113128

src/CostManagement/CostManagement/help/Invoke-AzCostManagementQuery.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Query the usage data for scope defined.
1717
Invoke-AzCostManagementQuery -Scope <String> -Timeframe <TimeframeType> -Type <ExportType>
1818
[-ConfigurationColumn <String[]>] [-DatasetAggregation <Hashtable>] [-DatasetFilter <IQueryFilter>]
1919
[-DatasetGranularity <GranularityType>] [-DatasetGrouping <IQueryGrouping[]>] [-TimePeriodFrom <DateTime>]
20-
[-TimePeriodTo <DateTime>] [-DefaultProfile <PSObject>] [-WhatIf]
20+
[-TimePeriodTo <DateTime>] [-DefaultProfile <PSObject>] [-ProgressAction <ActionPreference>] [-WhatIf]
2121
[-Confirm] [<CommonParameters>]
2222
```
2323

@@ -27,7 +27,7 @@ Invoke-AzCostManagementQuery -ExternalCloudProviderId <String>
2727
-ExternalCloudProviderType <ExternalCloudProviderType> -Timeframe <TimeframeType> -Type <ExportType>
2828
[-ConfigurationColumn <String[]>] [-DatasetAggregation <Hashtable>] [-DatasetFilter <IQueryFilter>]
2929
[-DatasetGranularity <GranularityType>] [-DatasetGrouping <IQueryGrouping[]>] [-TimePeriodFrom <DateTime>]
30-
[-TimePeriodTo <DateTime>] [-DefaultProfile <PSObject>] [-WhatIf]
30+
[-TimePeriodTo <DateTime>] [-DefaultProfile <PSObject>] [-ProgressAction <ActionPreference>] [-WhatIf]
3131
[-Confirm] [<CommonParameters>]
3232
```
3333

@@ -188,6 +188,21 @@ Accept pipeline input: False
188188
Accept wildcard characters: False
189189
```
190190
191+
### -ProgressAction
192+
{{ Fill ProgressAction Description }}
193+
194+
```yaml
195+
Type: System.Management.Automation.ActionPreference
196+
Parameter Sets: (All)
197+
Aliases: proga
198+
199+
Required: False
200+
Position: Named
201+
Default value: None
202+
Accept pipeline input: False
203+
Accept wildcard characters: False
204+
```
205+
191206
### -Scope
192207
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.
193208

src/CostManagement/CostManagement/help/Invoke-AzCostManagementReservationDetailReport.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-m
1717
### By (Default)
1818
```
1919
Invoke-AzCostManagementReservationDetailReport -BillingAccountId <String> -EndDate <String> -StartDate <String>
20-
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-WhatIf] [-Confirm]
20+
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
2121
[<CommonParameters>]
2222
```
2323

2424
### By1
2525
```
2626
Invoke-AzCostManagementReservationDetailReport -BillingAccountId <String> -BillingProfileId <String>
2727
-EndDate <String> -StartDate <String> [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
28-
[-WhatIf] [-Confirm] [<CommonParameters>]
28+
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -135,6 +135,21 @@ Accept pipeline input: False
135135
Accept wildcard characters: False
136136
```
137137
138+
### -ProgressAction
139+
{{ Fill ProgressAction Description }}
140+
141+
```yaml
142+
Type: System.Management.Automation.ActionPreference
143+
Parameter Sets: (All)
144+
Aliases: proga
145+
146+
Required: False
147+
Position: Named
148+
Default value: None
149+
Accept pipeline input: False
150+
Accept wildcard characters: False
151+
```
152+
138153
### -StartDate
139154
Start Date
140155

src/CostManagement/CostManagement/help/New-AzCostManagementDetailReport.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The details on the file(s) available for download will be available in the polli
2222
```
2323
New-AzCostManagementDetailReport -Scope <String> [-BillingPeriod <String>] [-InvoiceId <String>]
2424
[-Metric <CostDetailsMetricType>] [-TimePeriodEnd <String>] [-TimePeriodStart <String>]
25-
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-WhatIf] [-Confirm]
25+
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
2626
[<CommonParameters>]
2727
```
2828

@@ -146,6 +146,21 @@ Accept pipeline input: False
146146
Accept wildcard characters: False
147147
```
148148
149+
### -ProgressAction
150+
{{ Fill ProgressAction Description }}
151+
152+
```yaml
153+
Type: System.Management.Automation.ActionPreference
154+
Parameter Sets: (All)
155+
Aliases: proga
156+
157+
Required: False
158+
Position: Named
159+
Default value: None
160+
Accept pipeline input: False
161+
Accept wildcard characters: False
162+
```
163+
149164
### -Scope
150165
The scope associated with usage details operations.
151166
This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope.

0 commit comments

Comments
 (0)