-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install-package docker fails : 'Get-WindowsFeature' is not recognized #26
Comments
Whats strange is if I execute an install-module ServerManager I still get this error. |
@enderb-ms you where looking into to something similar correct? |
I created some additional Data Center and Standard VMs and I was not able to repro this. Its only happening on one Standard Edition VM. |
cc/ @enderb-ms @taylorb-microsoft I found the issue. I don't understand exactly what is happening by one get but under the hood this is what I believe is happening. The Install-package command invokes a new runspace or powershell instance, in the instance only the default modules are loaded. Inside this package there is a call to Get-WindowsFeature. When this is called, powershell attempts to resolve the method. To do this is searches the $env:PSModulePath for modules that contain this method. Apparently it does not search all of the paths in this environment variables, it only searches some of them. I had a user environment variable, which boxstarter created , I deleted that. Then I put the path that contains the ServerManager modules (the module which contains get-windowsfeature) to the front of this environment variable. After that, I started a new powershell session and then the package was able to install correctly. |
I have only default module paths, it's clean Windows Server 2016.
I copied C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ServerManager to C:\Users\Administrator\Documents\WindowsPowerShell\Modules as a work-around. |
It does not work in 32-bit PowerShell. It's some strange file system virtualization.
|
I was using powershell x86 when i got this error. Switching to Powershell , resolved the problem |
The script should check for whether it's in a 32bit console then |
cc @johnstep in case you end up fiddling with the provider |
Hi, I'm having the same problem:
But, if I followed right what @erichexter it not worked for me. Someone knows an alternative? There is a way to install it manually? |
Getting this on Windows Enterprise host. |
Getting this on a windows server 2016 LTS had to add C:\Windows\system32\WindowsPowerShell\v1.0\Modules to my PsModulePath as suggested by @erichexter which solved the issue. |
Check if another module or function is overwriting the default Get-WindowsFeature. In our case we had Carbon (http://get-carbon.org) installed which took precedence over the default cmdlet. |
I'm using the DockerProvider through DSC, and figured I'd just set the Works like a charm. |
cc/ @jayshah-msft @taylorb-microsoft @friism
Repro steps:
I am getting an exception on this line: https://github.com/OneGet/MicrosoftDockerProvider/blob/developer/DockerMsftProvider.psm1#L586
Expected Result:
Docker and Docker Engine are install on server
Actual Result:
PS C:> Install-Package -Name docker -ProviderName DockerMsftProvider -Force
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
The text was updated successfully, but these errors were encountered: