File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ cache:
2121install :
2222 - ps : if ($env:PowerShellEdition -eq 'WindowsPowerShell') { Import-Module .\tools\appveyor.psm1; Invoke-AppveyorInstall }
2323 - pwsh : if ($env:PowerShellEdition -eq 'PowerShellCore') { Import-Module .\tools\appveyor.psm1; Invoke-AppveyorInstall }
24+ - ps : |
25+ # Windows image still has version 6.0.0 of pwsh but 6.0.2 is required due to System.Management.Automation package https://github.com/appveyor/ci/issues/2230
26+ if ($env:PowerShellEdition -eq 'PowerShellCore' -and $PSVersionTable.PSVersion -lt [version]'6.0.2' -and $IsWindows) {
27+ $msiPath = "$env:TEMP\PowerShell-6.0.2-win-x64.msi"
28+ (New-Object Net.WebClient).DownloadFile('https://github.com/PowerShell/PowerShell/releases/download/v6.0.2/PowerShell-6.0.2-win-x64.msi', $msiPath)
29+ Write-Verbose 'Installing pwsh 6.0.2' -Verbose
30+ Start-Process 'msiexec.exe' -Wait -ArgumentList "/i $msiPath /quiet"
31+ Remove-Item $msiPath
32+ $env:Path = "$env:ProgramFiles\PowerShell\6.0.2;$env:Path"
33+ }
2434
2535build_script :
2636 - ps : |
@@ -48,7 +58,7 @@ test_script:
4858 }
4959 }
5060 - pwsh : |
51- if ($env:PowerShellEdition -eq 'PowerShellCore' -and $PSVersionTable.PSVersion -ge [version]'6.0.2' ) {
61+ if ($env:PowerShellEdition -eq 'PowerShellCore') {
5262 $modulePath = $env:PSModulePath.Split([System.IO.Path]::PathSeparator) | Where-Object { Test-Path $_} | Select-Object -First 1
5363 Copy-Item "${env:APPVEYOR_BUILD_FOLDER}\out\PSScriptAnalyzer" "$modulePath\" -Recurse -Force
5464 $testResultsFile = ".\TestResults.xml"
You can’t perform that action at this time.
0 commit comments