From 7c9d7c304ab532e349c62f647e93993c9bf7177b Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Wed, 12 Apr 2023 09:56:51 +0800 Subject: [PATCH] Fix the issue of dll conflict between Az.Aks and Pester --- tools/Gen2Master/MoveFromGeneration2Master.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/Gen2Master/MoveFromGeneration2Master.ps1 b/tools/Gen2Master/MoveFromGeneration2Master.ps1 index 8c5ae48c2f7a..e6f0b518b3ef 100644 --- a/tools/Gen2Master/MoveFromGeneration2Master.ps1 +++ b/tools/Gen2Master/MoveFromGeneration2Master.ps1 @@ -352,8 +352,16 @@ Function Move-Generation2MasterHybrid { [string] $DestPath, [string] $Psd1FolderPostfix ) - Import-Module "$DestPath\..\..\artifacts\Debug\Az.$ModuleName\Az.$ModuleName.psd1" - Update-MarkdownHelpModule -Path "$DestPath\$ModuleName$Psd1FolderPostfix\help" -RefreshModulePage -AlphabeticParamsOrder -UseFullTypeName -ExcludeDontShow + $psd1Path = "$DestPath\..\..\artifacts\Debug\Az.$ModuleName\Az.$ModuleName.psd1" + $assemblyToRemove = "YamlDotNet.dll" + $psd1Data = Import-PowerShellDataFile -Path $psd1Path + if ($psd1Data.ContainsKey('RequiredAssemblies') -and $psd1Data.RequiredAssemblies -contains $assemblyToRemove) { + $psd1Data.RequiredAssemblies = $psd1Data.RequiredAssemblies | Where-Object { $_ -ne $assemblyToRemove } + Update-ModuleManifest -Path $psd1Path -RequiredAssemblies $psd1Data.RequiredAssemblies + } + Import-Module $psd1Path + Import-Module platyPS + Update-MarkdownHelpModule -Path "$DestPath\$ModuleName$Psd1FolderPostfix\help" -RefreshModulePage -AlphabeticParamsOrder -UseFullTypeName -ExcludeDontShow } -ArgumentList $ModuleName, $DestPath, $Psd1FolderPostfix $job | Wait-Job | Receive-Job