File tree 1 file changed +11
-1
lines changed 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ cache:
21
21
install :
22
22
- ps : if ($env:PowerShellEdition -eq 'WindowsPowerShell') { Import-Module .\tools\appveyor.psm1; Invoke-AppveyorInstall }
23
23
- 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
+ }
24
34
25
35
build_script :
26
36
- ps : |
@@ -48,7 +58,7 @@ test_script:
48
58
}
49
59
}
50
60
- pwsh : |
51
- if ($env:PowerShellEdition -eq 'PowerShellCore' -and $PSVersionTable.PSVersion -ge [version]'6.0.2' ) {
61
+ if ($env:PowerShellEdition -eq 'PowerShellCore') {
52
62
$modulePath = $env:PSModulePath.Split([System.IO.Path]::PathSeparator) | Where-Object { Test-Path $_} | Select-Object -First 1
53
63
Copy-Item "${env:APPVEYOR_BUILD_FOLDER}\out\PSScriptAnalyzer" "$modulePath\" -Recurse -Force
54
64
$testResultsFile = ".\TestResults.xml"
You can’t perform that action at this time.
0 commit comments