File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ Note: the PSScriptAnalyzer Chocolatey package is provided and supported by the c
108
108
#### Requirements
109
109
110
110
* [ .NET Core 3.1.102 SDK] ( https://www.microsoft.com/net/download/dotnet-core/3.1#sdk-3.1.102 ) or newer patch release
111
+ * [ Pester v4 PowerShell module, available on PowerShell Gallery] ( https://github.com/pester/Pester )
111
112
* [ PlatyPS PowerShell module, available on PowerShell Gallery] ( https://github.com/PowerShell/platyPS/releases )
112
113
* Optionally but recommended for development: [ Visual Studio 2017/2019] ( https://www.visualstudio.com/downloads/ )
113
114
Original file line number Diff line number Diff line change @@ -331,13 +331,14 @@ function Test-ScriptAnalyzer
331
331
}
332
332
$savedModulePath = $env: PSModulePath
333
333
$env: PSModulePath = " ${testModulePath} {0}${env: PSModulePath} " -f [System.IO.Path ]::PathSeparator
334
+ $importPesterV4 = ' Import-Module -Name Pester -MaximumVersion 4.99'
334
335
if ($ShowAll )
335
336
{
336
- $scriptBlock = [scriptblock ]::Create(" Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile " )
337
+ $scriptBlock = [scriptblock ]::Create(" $importPesterV4 ; Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile " )
337
338
}
338
339
else
339
340
{
340
- $scriptBlock = [scriptblock ]::Create(" Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile -Show Describe,Summary,Failed" )
341
+ $scriptBlock = [scriptblock ]::Create(" $importPesterV4 ; Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile -Show Describe,Summary,Failed" )
341
342
}
342
343
if ( $InProcess ) {
343
344
& $scriptBlock
Original file line number Diff line number Diff line change 4
4
$ErrorActionPreference = ' Stop'
5
5
6
6
function Install-Pester {
7
- $requiredPesterVersion = ' 4.10.0 '
7
+ $requiredPesterVersion = ' 4.10.1 '
8
8
$pester = Get-Module Pester - ListAvailable | Where-Object { $_.Version -eq $requiredPesterVersion }
9
9
if ($null -eq $pester ) {
10
10
if ($null -eq (Get-Module - ListAvailable PowershellGet)) {
@@ -15,7 +15,7 @@ function Install-Pester {
15
15
else {
16
16
# Visual Studio 2017 build (has already Pester v3, therefore a different installation mechanism is needed to make it also use the new version 4)
17
17
Write-Verbose - Verbose " Installing Pester via Install-Module"
18
- Install-Module - Name Pester - Force - SkipPublisherCheck - Scope CurrentUser - Repository PSGallery
18
+ Install-Module - Name Pester - MaximumVersion 4.99 - Force - SkipPublisherCheck - Scope CurrentUser - Repository PSGallery
19
19
}
20
20
}
21
21
}
You can’t perform that action at this time.
0 commit comments