New-AzUpgradeModulePlan
Generates a new upgrade plan for migrating to the Az PowerShell module.
Syntax
FromReferences
New-AzUpgradeModulePlan
-AzureRmCmdReference <CommandReference[]>
-ToAzVersion <String>
[-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzAliasMappingSpec <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[<CommonParameters>]
FromNewSearchByDirectory
New-AzUpgradeModulePlan
-FromAzureRmVersion <String>
-DirectoryPath <String>
-ToAzVersion <String>
[-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzAliasMappingSpec <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[<CommonParameters>]
FromNewSearchByFile
New-AzUpgradeModulePlan
-FromAzureRmVersion <String>
-FilePath <String>
-ToAzVersion <String>
[-AzureRmModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzModuleSpec <System.Collections.Generic.Dictionary`2[System.String,CommandDefinition]>]
[-AzAliasMappingSpec <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[<CommonParameters>]
Description
Generates a new upgrade plan for migrating to the Az PowerShell module. The upgrade plan details the specific file/offset points that require changes when moving from AzureRM commands to Az commands.
Examples
EXAMPLE 1
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 latest -FilePath 'C:\Scripts\my-azure-script.ps1'
EXAMPLE 2
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 latest -DirectoryPath 'C:\Scripts'
EXAMPLE 3
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 latest -AzureRmCmdReference $references
EXAMPLE 4
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 -AzureRM
$azSpec = Get-AzUpgradeCmdletSpec -Az -ModuleVersion latest
$azAliases = Get-AzUpgradeAliasSpec -ModuleVersion latest
# execute a batch of module upgrades
$plan1 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts1' -FromAzureRmVersion '6.13.1' -ToAzVersion latest -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan2 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts2' -FromAzureRmVersion '6.13.1' -ToAzVersion latest -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
$plan3 = New-AzUpgradeModulePlan -DirectoryPath 'C:\Scripts3' -FromAzureRmVersion '6.13.1' -ToAzVersion latest -AzureRmModuleSpec $armSpec -AzModuleSpec $azSpec -AzAliasMappingSpec $azAliases
Parameters
-AzAliasMappingSpec
Specifies an optional parameter to provide a pre-loaded Az cmdlet alias mapping table, returned from
Get-AzUpgradeAliasSpec
.
Parameter properties
Type: | Dictionary<TKey,TValue>[System.String,System.String] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-AzModuleSpec
Specifies an optional parameter to provide a pre-loaded Az module spec, returned from
Get-AzUpgradeCmdletSpec
.
Parameter properties
Type: | Dictionary<TKey,TValue>[System.String,CommandDefinition] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-AzureRmCmdReference
Specifies the AzureRM command references output from the Find-AzUpgradeCommandReference
cmdlet.
Parameter properties
Type: | CommandReference[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromReferences
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-AzureRmModuleSpec
Specifies an optional parameter to provide a pre-loaded AzureRM module spec, returned from
Get-AzUpgradeCmdletSpec
.
Parameter properties
Type: | Dictionary<TKey,TValue>[System.String,CommandDefinition] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DirectoryPath
Specifies the path to a folder where PowerShell scripts or modules reside.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromNewSearchByDirectory
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-FilePath
Specifies the path to a single PowerShell file.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromNewSearchByFile
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-FromAzureRmVersion
Specifies the AzureRM module version used in your existing PowerShell scripts(s) or modules.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromNewSearchByDirectory
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
FromNewSearchByFile
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ToAzVersion
Specifies the Az module version to upgrade to. Currently, only Az version 10.3 is supported.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.