Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the CI switch and related code from Restore-PSModuleToBuild?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

}

# Restore the Pester module
if ($CI) {
Restore-PSPester -Destination (Join-Path $publishPath "Modules")
}
}

Expand All @@ -646,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
Expand Down