From 914fa408a41c027d208cbaf070894683eac38690 Mon Sep 17 00:00:00 2001 From: Xiaogang Date: Wed, 9 Jun 2021 13:12:23 +0800 Subject: [PATCH] should not try to use existed module version for new modules (#15217) --- tools/Gen2Master/MoveFromGeneration2Master.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/Gen2Master/MoveFromGeneration2Master.ps1 b/tools/Gen2Master/MoveFromGeneration2Master.ps1 index 06c809f9409f..724d1f561c98 100644 --- a/tools/Gen2Master/MoveFromGeneration2Master.ps1 +++ b/tools/Gen2Master/MoveFromGeneration2Master.ps1 @@ -64,7 +64,9 @@ Function Move-Generation2Master { $Psd1Version = $Psd1Metadata.ModuleVersion } $Psd1Metadata = Import-LocalizedData -BaseDirectory $SourcePath -FileName "Az.$ModuleName.psd1" - $Psd1Metadata.ModuleVersion = $Psd1Version + if ($Null -ne $Psd1Version) { + $Psd1Metadata.ModuleVersion = $Psd1Version + } If ($Null -ne $ModuleGuid) { $Psd1Metadata.GUID = $ModuleGuid }