Skip to content

Installing Docker EE via DockerMSFTProvider doesn't work on Windows 10 #47

@tristanbarcelon

Description

@tristanbarcelon

When I attempt to install Docker EE on Windows 10 pro or workstation editions version 1803 using powershell cmdlet Install-Package Docker -ProviderName DockerMsftProvider -RequiredVersion "18.03.1-ee-2" -Force, I get the error: _Install-Package : The term 'Get-WindowsFeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1

  • Install-Package Docker -ProviderName DockerMsftProvider -RequiredVers ...
  •   + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
      + FullyQualifiedErrorId : FailedToDownload,Install-Package,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage_
    
    

I suspect this is caused by a bug on lines 588 and 603 where the switch statement on Win32_OperatingSystem.Caption returns something other than 'Microsoft Windows 10'. I'd like to suggest changing the OS detection scheme as follows:

1). Create a variable for capturing the OS caption.

[string] $OSCaption = Get-wmiobject -class win32_operatingsystem | select-object -ExpandProperty Caption

2). Change the switch statement on lines 587-588 and 602-603 as follows:

switch -Wildcard ($OSCaption) {
'Microsoft Windows 10*' {
.....
}
}

On my machine, Get-wmiobject -class win32_operatingsystem | select-object -ExpandProperty Caption returns Microsoft Windows 10 Pro for Workstations, while on a Windows Server 2016, the same cmdlet returns Microsoft Windows Server 2016 Standard. This should allow dockermsftprovider to get past the install package error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions