From 4115d19d5f373a012dc77fa815f19f57dd28126f Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Thu, 27 May 2021 14:29:29 +0800 Subject: [PATCH] AzPreview use latest Az.Accounts version (#15111) * AzPreview use latest Az.Accounts version * Update RunVersionController.ps1 Co-authored-by: Dingmeng Xue --- tools/AzPreview/AzPreview.psd1 | 2 +- tools/RunVersionController.ps1 | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/AzPreview/AzPreview.psd1 b/tools/AzPreview/AzPreview.psd1 index 8859249fe1bc..aa8078e313e8 100644 --- a/tools/AzPreview/AzPreview.psd1 +++ b/tools/AzPreview/AzPreview.psd1 @@ -52,7 +52,7 @@ DotNetFrameworkVersion = '4.7.2' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @(@{ModuleName = 'Az.Accounts'; RequiredVersion = '2.3.0'; }, +RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.3.0'; }, @{ModuleName = 'Az.ADDomainServices'; RequiredVersion = '0.1.0'; }, @{ModuleName = 'Az.Advisor'; RequiredVersion = '1.1.1'; }, @{ModuleName = 'Az.Aks'; RequiredVersion = '2.1.0'; }, diff --git a/tools/RunVersionController.ps1 b/tools/RunVersionController.ps1 index 5a3f88cb403f..c470a4b867ac 100644 --- a/tools/RunVersionController.ps1 +++ b/tools/RunVersionController.ps1 @@ -288,8 +288,14 @@ function Generate-AzPreview $Psd1Object = Import-PowerShellDataFile $Psd1FilePath $moduleName = "Az.${ModuleName}" $moduleVersion = $Psd1Object.ModuleVersion.ToString() - $requiredModulesString += "@{ModuleName = '$moduleName'; RequiredVersion = '$moduleVersion'; }, - " + if('Az.Accounts' -eq $moduleName) + { + $requiredModulesString += "@{ModuleName = '$moduleName'; ModuleVersion = '$moduleVersion'; }, `n " + } + else + { + $requiredModulesString += "@{ModuleName = '$moduleName'; RequiredVersion = '$moduleVersion'; }, `n " + } } } $requiredModulesString = $requiredModulesString.Trim() @@ -367,4 +373,4 @@ switch ($PSCmdlet.ParameterSetName) Generate-AzPreview } -} \ No newline at end of file +}