Merge pull request #837 from dfinke/UpdatePesterInstall

Prevent install of Pester v5
This commit is contained in:
Doug Finke
2020-05-04 18:52:27 -04:00
committed by GitHub
3 changed files with 66 additions and 64 deletions

View File

@@ -225,7 +225,9 @@ if (-not $SkipPostChecks) {
PivotData = @{RuleName = 'Count' } PivotData = @{RuleName = 'Count' }
PivotRows = 'Severity', 'RuleName' PivotRows = 'Severity', 'RuleName'
PivotTotals = 'Rows' PivotTotals = 'Rows'
PivotChartDefinition = $chartDef }} PivotChartDefinition = $chartDef
}
}
} }
Remove-Item -Path $ExcelParams['Path'] -ErrorAction SilentlyContinue Remove-Item -Path $ExcelParams['Path'] -ErrorAction SilentlyContinue
$AnalyzerResults | Export-Excel @ExcelParams $AnalyzerResults | Export-Excel @ExcelParams
@@ -245,7 +247,7 @@ if (Test-Path $script:warningfile) {
if (-not $SkipPesterTests -and (Get-ChildItem -Recurse *.tests.ps1)) { if (-not $SkipPesterTests -and (Get-ChildItem -Recurse *.tests.ps1)) {
Import-Module -Force $outputFile Import-Module -Force $outputFile
if (-not (Get-Module -ListAvailable pester | Where-Object -Property version -ge ([version]::new(4, 4, 1)))) { if (-not (Get-Module -ListAvailable pester | Where-Object -Property version -ge ([version]::new(4, 4, 1)))) {
Install-Module Pester -Force -SkipPublisherCheck Install-Module Pester -Force -SkipPublisherCheck -MaximumVersion 4.99.99
} }
Import-Module Pester Import-Module Pester
$PesterOutputPath = Join-Path $pwd -ChildPath ('TestResultsPS{0}.xml' -f $PSVersionTable.PSVersion) $PesterOutputPath = Join-Path $pwd -ChildPath ('TestResultsPS{0}.xml' -f $PSVersionTable.PSVersion)

View File

@@ -25,12 +25,12 @@ skip_commits:
# Scripts that run after cloning repository # Scripts that run after cloning repository
install: install:
- ps: 'Install-Module -Name Pester -Force -SkipPublisherCheck' - ps: 'Install-Module -Name Pester -Force -SkipPublisherCheck -MaximumVersion 4.99.99'
- ps: 'Install-Module -Name Assert -Force' - ps: 'Install-Module -Name Assert -Force -MaximumVersion 4.99.99'
# PowerShell Core # PowerShell Core
- ps: '& .\CI\InstallPowerShell.ps1 -Version "7.0.0-preview.4"' # Install other PowerShell Core version (Optional) - ps: '& .\CI\InstallPowerShell.ps1 -Version "7.0.0-preview.4"' # Install other PowerShell Core version (Optional)
- pwsh: 'Install-Module -Name Pester -Force' - pwsh: 'Install-Module -Name Pester -Force -MaximumVersion 4.99.99'
- pwsh: 'Install-Module -Name Assert -Force' - pwsh: 'Install-Module -Name Assert -Force -MaximumVersion 4.99.99'
# To run your custom scripts instead of automatic tests # To run your custom scripts instead of automatic tests
test_script: test_script:
@@ -56,8 +56,8 @@ for:
# Scripts that run after cloning repository # Scripts that run after cloning repository
install: install:
- pwsh: '& .\CI\CI.ps1 -Initialize' # Set AppVeyor build version - pwsh: '& .\CI\CI.ps1 -Initialize' # Set AppVeyor build version
- pwsh: 'Install-Module -Name Pester -Force' - pwsh: 'Install-Module -Name Pester -Force -MaximumVersion 4.99.99'
- pwsh: 'Install-Module -Name Assert -Force' - pwsh: 'Install-Module -Name Assert -Force -MaximumVersion 4.99.99'
# To run your custom scripts instead of automatic tests # To run your custom scripts instead of automatic tests
test_script: test_script:
- pwsh: '& .\CI\CI.ps1 -Test' - pwsh: '& .\CI\CI.ps1 -Test'

View File

@@ -20,7 +20,7 @@ jobs:
vmImage: 'windows-latest' vmImage: 'windows-latest'
steps: steps:
- powershell: 'Install-Module -Name Pester -Force -SkipPublisherCheck' - powershell: 'Install-Module -Name Pester -Force -SkipPublisherCheck -MaximumVersion 4.99.99'
displayName: 'Update Pester' displayName: 'Update Pester'
- powershell: './CI/CI.ps1 -Test' - powershell: './CI/CI.ps1 -Test'
displayName: 'Install and Test' displayName: 'Install and Test'
@@ -49,7 +49,7 @@ jobs:
vmImage: 'windows-latest' vmImage: 'windows-latest'
steps: steps:
- pwsh: 'Install-Module -Name Pester -Force' - pwsh: 'Install-Module -Name Pester -Force -MaximumVersion 4.99.99'
displayName: 'Update Pester' displayName: 'Update Pester'
- pwsh: './CI/CI.ps1 -Test' - pwsh: './CI/CI.ps1 -Test'
displayName: 'Install and Test' displayName: 'Install and Test'
@@ -65,7 +65,7 @@ jobs:
vmImage: 'ubuntu-latest' vmImage: 'ubuntu-latest'
steps: steps:
- powershell: 'Install-Module -Name Pester -Force' - powershell: 'Install-Module -Name Pester -Force -MaximumVersion 4.99.99'
displayName: 'Update Pester' displayName: 'Update Pester'
- powershell: './CI/CI.ps1 -Test' - powershell: './CI/CI.ps1 -Test'
displayName: 'Install and Test' displayName: 'Install and Test'
@@ -83,7 +83,7 @@ jobs:
steps: steps:
- script: brew install mono-libgdiplus - script: brew install mono-libgdiplus
displayName: 'Install mono-libgdiplus' displayName: 'Install mono-libgdiplus'
- powershell: 'Install-Module -Name Pester -Force' - powershell: 'Install-Module -Name Pester -Force -MaximumVersion 4.99.99'
displayName: 'Update Pester' displayName: 'Update Pester'
- powershell: './CI/CI.ps1 -Test' - powershell: './CI/CI.ps1 -Test'
displayName: 'Install and Test' displayName: 'Install and Test'