diff --git a/build.psm1 b/build.psm1 index 1586776fee..2bff622634 100644 --- a/build.psm1 +++ b/build.psm1 @@ -652,7 +652,8 @@ function Restore-PSModuleToBuild $modulesDir = Join-Path -Path $publishPath -ChildPath "Modules" # Restore modules from powershellgallery feed - # PowerShellGet depends on PackageManagement module, so PackageManagement module will be installed with the PowerShellGet module. + # PowerShellGet depends on PackageManagement module, so we will install PackageManagement module first. + Restore-PSModule -Destination $modulesDir -Name 'PackageManagement' -RequiredVersion '1.1.7.0' -SourceLocation "https://www.powershellgallery.com/api/v2/" Restore-PSModule -Destination $modulesDir -Name 'PowerShellGet' -RequiredVersion '1.6.0' -SourceLocation "https://www.powershellgallery.com/api/v2/" Restore-PSModule -Destination $modulesDir -Name 'Microsoft.PowerShell.Archive' -SourceLocation "https://www.powershellgallery.com/api/v2/"