Skip to content

Commit 3516ce0

Browse files
authored
Support Az 6.1 (#92)
1 parent b1fba7a commit 3516ce0

File tree

84 files changed

+23366
-6092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+23366
-6092
lines changed

Diff for: docs/how-to-update-az-module-spec.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Occasionally, these should be updated to latest. This document describes how to
1010
Have the following installed on your system:
1111

1212
* PowerShell 7.x or later.
13+
* Pester 4.10.1 (5.* cannot work due to breaking change)
1314
* Cloned the [azure-powershell-migration](https://github.com/Azure/azure-powershell-migration)
1415
GitHub repository to your local computer.
1516

Diff for: docs/quickstart-migrate-azurerm-to-az-automatically.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ points that require changes when moving from AzureRM to the Az PowerShell cmdlet
4444
4545
```powershell
4646
# Generate an upgrade plan for the specified PowerShell script and save it to a variable.
47-
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 5.6.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
47+
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 6.1.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
4848
```
4949

5050
```powershell
5151
# Generate an upgrade plan for all the scripts and module files in the specified folder and save it to a variable.
52-
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 5.6.0 -DirectoryPath 'C:\Scripts'
52+
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 6.1.0 -DirectoryPath 'C:\Scripts'
5353
```
5454

5555
Review the results of the upgrade plan.
@@ -106,7 +106,7 @@ $Results | Where-Object UpgradeResult -ne UpgradeCompleted | Format-List
106106

107107
* File I/O operations use default encoding. Unusual file encoding situations may cause problems.
108108
* AzureRM cmdlets passed as arguments to Pester unit test mock statements aren't detected.
109-
* Currently, only Az PowerShell module version 5.6.0 is supported as a target.
109+
* Currently, only Az PowerShell module version 6.1.0 is supported as a target.
110110

111111
## Next steps
112112

Diff for: powershell-module/Az.Tools.Migration/Az.Tools.Migration.psd1

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RootModule = 'Az.Tools.Migration.psm1'
44

55
# Version number of this module.
6-
ModuleVersion = '1.1.1'
6+
ModuleVersion = '1.1.2'
77

88
# Supported PSEditions
99
CompatiblePSEditions = 'Core', 'Desktop'
@@ -108,7 +108,7 @@
108108
# IconUri = ''
109109

110110
# ReleaseNotes of this module
111-
ReleaseNotes = '* Fixed a bug in Invoke-AzUpgradeModulePlan where dynamic parameters are incorrectly updated (issue #81).'
111+
ReleaseNotes = '* Upgrade Az version to 6.1.0'
112112
}
113113
}
114114

Diff for: powershell-module/Az.Tools.Migration/Functions/Public/Get-AzUpgradeAliasSpec.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ function Get-AzUpgradeAliasSpec
1111
Specify the version of the module to import command aliases from.
1212
1313
.EXAMPLE
14-
PS C:\> Get-AzUpgradeAliasSpec -ModuleVersion "5.6.0"
15-
Returns the cmdlet alias mappings table for Az 5.6.0.
14+
PS C:\> Get-AzUpgradeAliasSpec -ModuleVersion "6.1.0"
15+
Returns the cmdlet alias mappings table for Az 6.1.0.
1616
#>
1717
[CmdletBinding()]
1818
Param

Diff for: powershell-module/Az.Tools.Migration/Functions/Public/Invoke-AzUpgradeModulePlan.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function Invoke-AzUpgradeModulePlan
2323
The following example invokes the upgrade plan for a PowerShell module named "myModule" and saves the updated file contents into new files (leaving original files unmodified).
2424
2525
# step 1: generate a plan and save it to a variable.
26-
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 5.6.0 -DirectoryPath 'C:\Scripts\myModule'
26+
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 6.1.0 -DirectoryPath 'C:\Scripts\myModule'
2727
2828
# step 2: write the plan to the console to review the upgrade steps, warnings, and errors.
2929
$plan
@@ -38,7 +38,7 @@ function Invoke-AzUpgradeModulePlan
3838
The following example invokes the upgrade plan for a PowerShell module named "myModule" and modifies the existing files in place.
3939
4040
# step 1: generate a plan and save it to a variable.
41-
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 5.6.0 -DirectoryPath 'C:\Scripts\myModule'
41+
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 6.1.0 -DirectoryPath 'C:\Scripts\myModule'
4242
4343
# step 2: write the plan to the console to review the upgrade steps, warnings, and errors.
4444
$plan

Diff for: powershell-module/Az.Tools.Migration/Functions/Public/New-AzUpgradeModulePlan.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function New-AzUpgradeModulePlan
1111
Specifies the AzureRM module version used in your existing PowerShell scripts(s) or modules.
1212
1313
.PARAMETER ToAzVersion
14-
Specifies the Az module version to upgrade to. Currently, only Az version 5.6.0 is supported.
14+
Specifies the Az module version to upgrade to. Currently, only Az version 6.1.0 is supported.
1515
1616
.PARAMETER FilePath
1717
Specifies the path to a single PowerShell file.
@@ -34,32 +34,32 @@ function New-AzUpgradeModulePlan
3434
.EXAMPLE
3535
The following example generates a new Az module upgrade plan for the script file 'C:\Scripts\my-azure-script.ps1'.
3636
37-
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 5.6.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
37+
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 6.1.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
3838
3939
.EXAMPLE
4040
The following example generates a new Az module upgrade plan for the script and module files located under C:\Scripts.
4141
42-
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 5.6.0 -DirectoryPath 'C:\Scripts'
42+
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 6.1.0 -DirectoryPath 'C:\Scripts'
4343
4444
.EXAMPLE
4545
The following example generates a new Az module upgrade plan for the script and module files under C:\Scripts.
4646
4747
$references = Find-AzUpgradeCommandReference -DirectoryPath 'C:\Scripts' -AzureRmVersion '6.13.1'
48-
New-AzUpgradeModulePlan -ToAzVersion 5.6.0 -AzureRmCmdReference $references
48+
New-AzUpgradeModulePlan -ToAzVersion 6.1.0 -AzureRmCmdReference $references
4949
5050
.EXAMPLE
5151
The following example generates a new Az module upgrade plan for the script and module files under several directories.
5252
Module specs are pre-loaded here to avoid re-loading the spec each time a plan is generated.
5353
5454
# pre-load specifications
5555
$armSpec = Get-AzUpgradeCmdletSpec -ModuleName "AzureRM" -ModuleVersion "6.13.1"
56-
$azSpec = Get-AzUpgradeCmdletSpec -ModuleName "Az" -ModuleVersion "5.6.0"
57-
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion "5.6.0"
56+
$azSpec = Get-AzUpgradeCmdletSpec -ModuleName "Az" -ModuleVersion "6.1.0"
57+
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion "6.1.0"
5858
5959
# execute a batch of module upgrades
60-
$plan1 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts1' -FromAzureRmVersion '6.13.1' -ToAzVersion '5.6.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
61-
$plan2 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts2' -FromAzureRmVersion '6.13.1' -ToAzVersion '5.6.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
62-
$plan3 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts3' -FromAzureRmVersion '6.13.1' -ToAzVersion '5.6.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
60+
$plan1 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts1' -FromAzureRmVersion '6.13.1' -ToAzVersion '6.1.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
61+
$plan2 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts2' -FromAzureRmVersion '6.13.1' -ToAzVersion '6.1.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
62+
$plan3 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts3' -FromAzureRmVersion '6.13.1' -ToAzVersion '6.1.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
6363
#>
6464
[CmdletBinding()]
6565
Param
@@ -103,7 +103,7 @@ function New-AzUpgradeModulePlan
103103
Mandatory=$true,
104104
HelpMessage='Specify the Az module version to upgrade to.')]
105105
[System.String]
106-
[ValidateSet('5.6.0')]
106+
[ValidateSet('6.1.0')]
107107
$ToAzVersion,
108108

109109
[Parameter(Mandatory=$false)]

0 commit comments

Comments
 (0)