Skip to content
This repository was archived by the owner on Apr 28, 2018. It is now read-only.

Commit f94a670

Browse files
committed
Fixing binary module load on 5.0
The "PSEdition" property we were checking for doesn't exist in PowerShell 5.0, which caused us to incorrectly try to load coreclr binaries on 5.0. Also changing appveyor.yml to run dotnet cli install directly instead of launching another process and waiting, and adding explicit check/throw if module doesn't load to avoid false positives.
1 parent 8d61cad commit f94a670

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ image: WMF 5
55
init:
66
- ps: Install-PackageProvider NuGet -Force
77
- ps: (new-object net.webclient).DownloadFile('https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.exe', "c:/dotnet-install.exe")
8-
- ps: Start-Process c:\dotnet-install.exe -ArgumentList "/install","/quiet" -Wait
8+
- cmd: c:\dotnet-install.exe /install /quiet
99
install:
1010
- ps: Install-Module platyPS -Force
1111
- cmd: git submodule update --init --recursive
@@ -48,6 +48,10 @@ test_script:
4848
- ps: Register-PSRepository -Name test -SourceLocation $pwd\bin
4949
- ps: Install-Module -Name Docker -Repository test -Force
5050
- ps: Import-Module Docker
51+
- ps: |
52+
if (!(gcm -Module Docker)){
53+
throw "Module failed to load: no commands found."
54+
}
5155
- ps: git checkout -- src/Docker.PowerShell/Docker.psd1
5256
- ps: git checkout -- src/Docker.PowerShell/project.json
5357
- ps: git config core.autocrlf true

src/Docker.PowerShell/Docker.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $PSModuleRoot = $PSModule.ModuleBase
1414

1515
# Import the appropriate nested binary module based on the current PowerShell version
1616
$binaryModuleRoot = $PSModuleRoot
17-
if ($PSVersionTable["PSEdition"] -ne 'Desktop')
17+
if ($PSVersionTable["PSEdition"] -eq 'Core')
1818
{
1919
$binaryModuleRoot = Join-Path -Path $PSModuleRoot -ChildPath 'coreclr'
2020
}

0 commit comments

Comments
 (0)