Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Commit 2b56fd5

Browse files
committed
reordered Pester module installation so non-Pester stages don't spend cycles on installing it
1 parent 5911db2 commit 2b56fd5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

psake.ps1

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@ task Init {
3333
Set-Location $ProjectRoot
3434
"Build System Details:"
3535
Get-Item ENV:BH*
36-
if ($env:APPVEYOR) {
37-
Get-Item ENV:APPVEYOR*
38-
}
39-
"`n"
40-
41-
" Installing the latest version of Pester"
42-
Install-Module -Name Pester -Repository PSGallery -Scope CurrentUser -AllowClobber -SkipPublisherCheck -Confirm:$false -ErrorAction Stop -Force -Verbose:$false
43-
Import-Module -Name Pester -Verbose:$false -Force
36+
Get-Item ENV:BUILD*
4437
if ($env:BHProjectName -cne $moduleName) {
4538
$env:BHProjectName = $moduleName
4639
}
@@ -196,6 +189,9 @@ Task Import -Depends Compile {
196189
} -description 'Imports the newly compiled module'
197190

198191
$pesterScriptBlock = {
192+
" Installing the latest version of Pester"
193+
Install-Module -Name Pester -Repository PSGallery -Scope CurrentUser -AllowClobber -SkipPublisherCheck -Confirm:$false -ErrorAction Stop -Force -Verbose:$false
194+
Import-Module -Name Pester -Verbose:$false -Force
199195
" Getting correctly cased FullName for $outputModDir..."
200196
$outputModDir = (Get-ChildItem (Split-Path $outputModDir -Parent) -Directory | Where-Object {$_.Name -eq (Get-Item $outputModDir).Name}).FullName
201197
" FullName resolved to $outputModDir..."

0 commit comments

Comments
 (0)