Skip to content

Commit a94b472

Browse files
authored
Support "Move-Generation2Master" script for full path input (#13660)
* Support "Move-Generation2Master" script for full path input * Unified path
1 parent c624a64 commit a94b472

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/Gen2Master/MoveFromGeneration2Master.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Function Move-Generation2Master {
88

99
process {
1010
$ModuleName = ($SourcePath.Trim("\").Split("\"))[-1]
11-
If (-not ($DestPath -Match $ModuleName)) {
11+
If (-not ($DestPath.Trim("\").Split("\"))[-1] -eq $ModuleName)) {
1212
$DestPath = Join-Path -Path $DestPath -ChildPath $ModuleName
1313
}
1414
If (-not (Test-Path $DestPath)) {
@@ -67,7 +67,8 @@ Function Move-Generation2Master {
6767
$Psd1Metadata.GUID = $ModuleGuid
6868
}
6969
If ($Null -eq $RequiredModule) {
70-
$AccountsModulePath = [System.IO.Path]::Combine($DestPath, '..', 'Accounts', 'Accounts')
70+
$FullDestPath = Resolve-Path -path $DestPath
71+
$AccountsModulePath = [System.IO.Path]::Combine($FullDestPath, 'Accounts', 'Accounts')
7172
$AccountsMetadata = Import-LocalizedData -BaseDirectory $AccountsModulePath -FileName "Az.Accounts.psd1"
7273
$RequiredModule = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = $AccountsMetadata.ModuleVersion; })
7374
}

0 commit comments

Comments
 (0)