diff --git a/build.psm1 b/build.psm1 index a9f7c13cb4..1586776fee 100644 --- a/build.psm1 +++ b/build.psm1 @@ -652,11 +652,9 @@ function Restore-PSModuleToBuild $modulesDir = Join-Path -Path $publishPath -ChildPath "Modules" # Restore modules from powershellgallery feed - Restore-PSModule -Destination $modulesDir -Name @( - # PowerShellGet depends on PackageManagement module, so PackageManagement module will be installed with the PowerShellGet module. - 'PowerShellGet' - 'Microsoft.PowerShell.Archive' - ) -SourceLocation "https://www.powershellgallery.com/api/v2/" + # PowerShellGet depends on PackageManagement module, so PackageManagement module will be installed with the PowerShellGet module. + 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/" if($CI.IsPresent) {