From 7866cfd213a9177a9948ae6f6484356b478ab920 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 21 Mar 2018 09:50:28 -0700 Subject: [PATCH 1/2] Make '-CI' not depend on '-PSModuleRestore' in 'Start-PSBuild' --- build.psm1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index 43d9363ce12..948fb12869a 100644 --- a/build.psm1 +++ b/build.psm1 @@ -635,9 +635,13 @@ Fix steps: # download modules from powershell gallery. # - PowerShellGet, PackageManagement, Microsoft.PowerShell.Archive - if($PSModuleRestore) - { - Restore-PSModuleToBuild -PublishPath $publishPath -CI:$CI.IsPresent + if ($PSModuleRestore) { + Restore-PSModuleToBuild -PublishPath $publishPath + } + + # Restore the Pester module + if ($CI) { + Restore-PSPester -Destination (Join-Path $publishPath "Modules") } } From 0c66b19ac8e4f826b6f875781d67525cc4dde6e7 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 21 Mar 2018 12:13:59 -0700 Subject: [PATCH 2/2] Remove '-CI' from 'Restore-PSModuleToBuild' --- build.psm1 | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/build.psm1 b/build.psm1 index 948fb12869a..f0331ba8d08 100644 --- a/build.psm1 +++ b/build.psm1 @@ -650,22 +650,12 @@ function Restore-PSModuleToBuild param( [Parameter(Mandatory)] [string] - $PublishPath, - [Switch] - $CI + $PublishPath ) Write-Log "Restore PowerShell modules to $publishPath" - $modulesDir = Join-Path -Path $publishPath -ChildPath "Modules" - Copy-PSGalleryModules -Destination $modulesDir - - if($CI.IsPresent) - { - # take the latest version of pester and install it so it may be used - Restore-PSPester -Destination $modulesDir - } } function Restore-PSPester