File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 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
108108#### Requirements
109109
110110* [ .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 )
111112* [ PlatyPS PowerShell module, available on PowerShell Gallery] ( https://github.com/PowerShell/platyPS/releases )
112113* Optionally but recommended for development: [ Visual Studio 2017/2019] ( https://www.visualstudio.com/downloads/ )
113114
Original file line number Diff line number Diff line change @@ -331,13 +331,14 @@ function Test-ScriptAnalyzer
331331 }
332332 $savedModulePath = $env: PSModulePath
333333 $env: PSModulePath = " ${testModulePath} {0}${env: PSModulePath} " -f [System.IO.Path ]::PathSeparator
334+ $importPesterV4 = ' Import-Module -Name Pester -MaximumVersion 4.99'
334335 if ($ShowAll )
335336 {
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 " )
337338 }
338339 else
339340 {
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" )
341342 }
342343 if ( $InProcess ) {
343344 & $scriptBlock
Original file line number Diff line number Diff line change 44$ErrorActionPreference = ' Stop'
55
66function Install-Pester {
7- $requiredPesterVersion = ' 4.10.0 '
7+ $requiredPesterVersion = ' 4.10.1 '
88 $pester = Get-Module Pester - ListAvailable | Where-Object { $_.Version -eq $requiredPesterVersion }
99 if ($null -eq $pester ) {
1010 if ($null -eq (Get-Module - ListAvailable PowershellGet)) {
@@ -15,7 +15,7 @@ function Install-Pester {
1515 else {
1616 # Visual Studio 2017 build (has already Pester v3, therefore a different installation mechanism is needed to make it also use the new version 4)
1717 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
1919 }
2020 }
2121}
You can’t perform that action at this time.
0 commit comments