Azure / azure-powershell-migration

Tools and resources to help migrate PowerShell scripts between incompatible versions of Az and AzureRM modules
MIT License
35 stars 18 forks source link

Cannot validate argument on parameter 'FromAzureRmVersion' & 'ToAzVersion' #115

Closed Abhijeet-0442 closed 1 year ago

Abhijeet-0442 commented 1 year ago

Component Az & AzureRM PowerShell Module (New-AzUpgradeModulePlan)

Description of the issue I'm trying to Migrate my Powershell scripts from AzureRM to AZ. While exploring option 1 which is the recommended one, I'm facing validate argument on parameters 'FromAzureRmVersion' & 'ToAzVersion. when I tried the below command with changed -ToAzVersion with 9.3.0 only it's working fine.

New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.1 -ToAzVersion 9.3.0 -DirectoryPath 'C:\test\Subscriptions\' -OutVariable Plan

Describe how to reproduce the issue New-AzUpgradeModulePlan -FromAzureRmVersion 6.13.2 -ToAzVersion 10.2.0 -DirectoryPath 'C:\test\Subscriptions\' -OutVariable Plan New-AzUpgradeModulePlan : Cannot validate argument on parameter 'FromAzureRmVersion'. The argument "6.13.2" does not belong to the set "6.13.1" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. At line:1 char:45

When I tried with different versions for -ToAzVersion, below are the responses.

New-AzUpgradeModulePlan -ToAzVersion 10.2.0 New-AzUpgradeModulePlan : Cannot validate argument on parameter 'ToAzVersion'. The argument "10.2.0" does not belong to the set "9.3.0" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. At line:1 char:38

PS C:\WINDOWS\system32> New-AzUpgradeModulePlan -ToAzVersion 10.1.0 New-AzUpgradeModulePlan : Cannot validate argument on parameter 'ToAzVersion'. The argument "10.1.0" does not belong to the set "9.3.0" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. At line:1 char:38

PS C:\WINDOWS\system32> New-AzUpgradeModulePlan -ToAzVersion 10.0.0 New-AzUpgradeModulePlan : Cannot validate argument on parameter 'ToAzVersion'. The argument "10.0.0" does not belong to the set "9.3.0" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. At line:1 char:38

PS C:\WINDOWS\system32> New-AzUpgradeModulePlan -ToAzVersion 9.7.1 New-AzUpgradeModulePlan : Cannot validate argument on parameter 'ToAzVersion'. The argument "9.7.1" does not belong to the set "9.3.0" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. At line:1 char:38

Environment

I'm executing the commands on my local machine, which has AZ & AzureRM update versions. Get-InstalledModule -Name AzureRM

Version Name Repository Description


6.13.2 AzureRM PSGallery Azure Resource Manager Module

Get-InstalledModule -Name Az

Version Name Repository Description


10.2.0 Az PSGallery Microsoft Azure PowerShell - Cmdlets to manage resources in Azure. This module is compatible with PowerShell and Windows PowerShell....

Error output New-AzUpgradeModulePlan : Cannot validate argument on parameter 'FromAzureRmVersion'. The argument "6.13.2" does not belong to the set "6.13.1" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. At line:1 char:45