Skip to content

Commit

Permalink
Update module spec to Az 9.3.0 (#106)
Browse files Browse the repository at this point in the history
* Upgrade cmdlet spec to Az 8.0.0

* update changelog

* Update psd1 for 1.1.3 release

* Update module spec to Az 9.3.0
  • Loading branch information
dingmeng-xue authored Jan 15, 2023
1 parent 8b263fd commit 887a099
Show file tree
Hide file tree
Showing 97 changed files with 40,947 additions and 15,920 deletions.
4 changes: 3 additions & 1 deletion docs/how-to-update-az-module-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Have the following installed on your system:

1. Update the Az PowerShell module version listed in documentation, function help, function
parameter validation, and unit tests. The easiest way to do this is to perform a search to find
and replace the old version. For example, search for '5.2.0' and replace with '5.6.0'.
and replace the previous version. The previous version can be found under `\powershell-module\Az.Tools.Migration\Resources\ModuleSpecs\Az`. For example, search for '5.2.0' and replace with '5.6.0'. Please do not replace all because some files containing previous version, such as changelog, should not be replaced.

1. Remove the old module spec files from module resources:
`powershell-module\Az.Tools.Migration\Resources\ModuleSpecs\Az\{old-version}`.
Expand All @@ -74,4 +74,6 @@ Have the following installed on your system:

Restart PowerShell if test is changed and module needs to be imported again.

1. Add new version and release notes to `powershell-module/ChangeLog.md` and `powershell-module/Az.Tools.Migration/Az.Tools.Migration.psd1`. It is usually patch release because no API changes

1. Submit a pull request to commit the new changes.
6 changes: 3 additions & 3 deletions docs/quickstart-migrate-azurerm-to-az-automatically.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ points that require changes when moving from AzureRM to the Az PowerShell cmdlet
```powershell
# Generate an upgrade plan for the specified PowerShell script and save it to a variable.
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 9.3.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
```

```powershell
# Generate an upgrade plan for all the scripts and module files in the specified folder and save it to a variable.
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.0 -DirectoryPath 'C:\Scripts'
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 9.3.0 -DirectoryPath 'C:\Scripts'
```

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

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

## Next steps

Expand Down
4 changes: 2 additions & 2 deletions powershell-module/Az.Tools.Migration/Az.Tools.Migration.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'Az.Tools.Migration.psm1'

# Version number of this module.
ModuleVersion = '1.1.3'
ModuleVersion = '1.1.4'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down Expand Up @@ -108,7 +108,7 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Upgrade Az version to 8.0.0'
ReleaseNotes = '* Upgrade Az version to 9.3.0'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function Get-AzUpgradeAliasSpec
Specify the version of the module to import command aliases from.
.EXAMPLE
PS C:\> Get-AzUpgradeAliasSpec -ModuleVersion "8.0.0"
Returns the cmdlet alias mappings table for Az 8.0.0.
PS C:\> Get-AzUpgradeAliasSpec -ModuleVersion "9.3.0"
Returns the cmdlet alias mappings table for Az 9.3.0.
#>
[CmdletBinding()]
Param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Invoke-AzUpgradeModulePlan
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).
# step 1: generate a plan and save it to a variable.
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.0 -DirectoryPath 'C:\Scripts\myModule'
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 9.3.0 -DirectoryPath 'C:\Scripts\myModule'
# step 2: write the plan to the console to review the upgrade steps, warnings, and errors.
$plan
Expand All @@ -38,7 +38,7 @@ function Invoke-AzUpgradeModulePlan
The following example invokes the upgrade plan for a PowerShell module named "myModule" and modifies the existing files in place.
# step 1: generate a plan and save it to a variable.
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.0 -DirectoryPath 'C:\Scripts\myModule'
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 9.3.0 -DirectoryPath 'C:\Scripts\myModule'
# step 2: write the plan to the console to review the upgrade steps, warnings, and errors.
$plan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function New-AzUpgradeModulePlan
Specifies the AzureRM module version used in your existing PowerShell scripts(s) or modules.
.PARAMETER ToAzVersion
Specifies the Az module version to upgrade to. Currently, only Az version 8.0.0 is supported.
Specifies the Az module version to upgrade to. Currently, only Az version 9.3.0 is supported.
.PARAMETER FilePath
Specifies the path to a single PowerShell file.
Expand All @@ -34,32 +34,32 @@ function New-AzUpgradeModulePlan
.EXAMPLE
The following example generates a new Az module upgrade plan for the script file 'C:\Scripts\my-azure-script.ps1'.
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 9.3.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
.EXAMPLE
The following example generates a new Az module upgrade plan for the script and module files located under C:\Scripts.
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.0 -DirectoryPath 'C:\Scripts'
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 9.3.0 -DirectoryPath 'C:\Scripts'
.EXAMPLE
The following example generates a new Az module upgrade plan for the script and module files under C:\Scripts.
$references = Find-AzUpgradeCommandReference -DirectoryPath 'C:\Scripts' -AzureRmVersion '6.13.1'
New-AzUpgradeModulePlan -ToAzVersion 8.0.0 -AzureRmCmdReference $references
New-AzUpgradeModulePlan -ToAzVersion 9.3.0 -AzureRmCmdReference $references
.EXAMPLE
The following example generates a new Az module upgrade plan for the script and module files under several directories.
Module specs are pre-loaded here to avoid re-loading the spec each time a plan is generated.
# pre-load specifications
$armSpec = Get-AzUpgradeCmdletSpec -ModuleName "AzureRM" -ModuleVersion "6.13.1"
$azSpec = Get-AzUpgradeCmdletSpec -ModuleName "Az" -ModuleVersion "8.0.0"
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion "8.0.0"
$azSpec = Get-AzUpgradeCmdletSpec -ModuleName "Az" -ModuleVersion "9.3.0"
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion "9.3.0"
# execute a batch of module upgrades
$plan1 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts1' -FromAzureRmVersion '6.13.1' -ToAzVersion '8.0.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan2 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts2' -FromAzureRmVersion '6.13.1' -ToAzVersion '8.0.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan3 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts3' -FromAzureRmVersion '6.13.1' -ToAzVersion '8.0.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan1 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts1' -FromAzureRmVersion '6.13.1' -ToAzVersion '9.3.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan2 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts2' -FromAzureRmVersion '6.13.1' -ToAzVersion '9.3.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan3 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts3' -FromAzureRmVersion '6.13.1' -ToAzVersion '9.3.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
#>
[CmdletBinding()]
Param
Expand Down Expand Up @@ -103,7 +103,7 @@ function New-AzUpgradeModulePlan
Mandatory=$true,
HelpMessage='Specify the Az module version to upgrade to.')]
[System.String]
[ValidateSet('8.0.0')]
[ValidateSet('9.3.0')]
$ToAzVersion,

[Parameter(Mandatory=$false)]
Expand Down

This file was deleted.

Loading

0 comments on commit 887a099

Please sign in to comment.