Skip to content

Commit

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

* update changelog
  • Loading branch information
dingmeng-xue authored Jun 6, 2022
1 parent 9fd4950 commit fdec690
Show file tree
Hide file tree
Showing 91 changed files with 67,539 additions and 13,077 deletions.
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 6.1.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.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 6.1.0 -DirectoryPath 'C:\Scripts'
$Plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.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 6.1.0 is supported as a target.
* Currently, only Az PowerShell module version 8.0.0 is supported as a target.

## Next steps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Upgrade Az version to 6.1.0'
ReleaseNotes = '* Upgrade Az version to 8.0.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 "6.1.0"
Returns the cmdlet alias mappings table for Az 6.1.0.
PS C:\> Get-AzUpgradeAliasSpec -ModuleVersion "8.0.0"
Returns the cmdlet alias mappings table for Az 8.0.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 6.1.0 -DirectoryPath 'C:\Scripts\myModule'
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.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 6.1.0 -DirectoryPath 'C:\Scripts\myModule'
$plan = New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.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 6.1.0 is supported.
Specifies the Az module version to upgrade to. Currently, only Az version 8.0.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 6.1.0 -FilePath 'C:\Scripts\my-azure-script.ps1'
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.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 6.1.0 -DirectoryPath 'C:\Scripts'
New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 8.0.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 6.1.0 -AzureRmCmdReference $references
New-AzUpgradeModulePlan -ToAzVersion 8.0.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 "6.1.0"
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion "6.1.0"
$azSpec = Get-AzUpgradeCmdletSpec -ModuleName "Az" -ModuleVersion "8.0.0"
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion "8.0.0"
# execute a batch of module upgrades
$plan1 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts1' -FromAzureRmVersion '6.13.1' -ToAzVersion '6.1.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan2 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts2' -FromAzureRmVersion '6.13.1' -ToAzVersion '6.1.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan3 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts3' -FromAzureRmVersion '6.13.1' -ToAzVersion '6.1.0' -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$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
#>
[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('6.1.0')]
[ValidateSet('8.0.0')]
$ToAzVersion,

[Parameter(Mandatory=$false)]
Expand Down
Loading

0 comments on commit fdec690

Please sign in to comment.