From a94b472fd2c61a68ac862978f8562ecd69e80407 Mon Sep 17 00:00:00 2001 From: Youri970410 <62531040+Youri970410@users.noreply.github.com> Date: Mon, 7 Dec 2020 14:23:06 +0800 Subject: [PATCH] Support "Move-Generation2Master" script for full path input (#13660) * Support "Move-Generation2Master" script for full path input * Unified path --- tools/Gen2Master/MoveFromGeneration2Master.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/Gen2Master/MoveFromGeneration2Master.ps1 b/tools/Gen2Master/MoveFromGeneration2Master.ps1 index 60fc1f2d6796..5b3e9a15bda6 100644 --- a/tools/Gen2Master/MoveFromGeneration2Master.ps1 +++ b/tools/Gen2Master/MoveFromGeneration2Master.ps1 @@ -8,7 +8,7 @@ Function Move-Generation2Master { process { $ModuleName = ($SourcePath.Trim("\").Split("\"))[-1] - If (-not ($DestPath -Match $ModuleName)) { + If (-not ($DestPath.Trim("\").Split("\"))[-1] -eq $ModuleName)) { $DestPath = Join-Path -Path $DestPath -ChildPath $ModuleName } If (-not (Test-Path $DestPath)) { @@ -67,7 +67,8 @@ Function Move-Generation2Master { $Psd1Metadata.GUID = $ModuleGuid } If ($Null -eq $RequiredModule) { - $AccountsModulePath = [System.IO.Path]::Combine($DestPath, '..', 'Accounts', 'Accounts') + $FullDestPath = Resolve-Path -path $DestPath + $AccountsModulePath = [System.IO.Path]::Combine($FullDestPath, 'Accounts', 'Accounts') $AccountsMetadata = Import-LocalizedData -BaseDirectory $AccountsModulePath -FileName "Az.Accounts.psd1" $RequiredModule = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = $AccountsMetadata.ModuleVersion; }) }