Skip to content

Commit

Permalink
Support "Move-Generation2Master" script for full path input (#13660)
Browse files Browse the repository at this point in the history
* Support "Move-Generation2Master" script for full path input

* Unified path
  • Loading branch information
Youri970410 authored Dec 7, 2020
1 parent c624a64 commit a94b472
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/Gen2Master/MoveFromGeneration2Master.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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; })
}
Expand Down

0 comments on commit a94b472

Please sign in to comment.