Import-Module posh-docker
is not working on Power Shell while running as administrator
Am trying to enable auto-completion of commands for the current PowerShell but getting below error. executionpolicy is already set to RemoteSigned. I have Docker Toolbox in my system.
Import-Module : The specified module 'posh-docker' was not loaded because no valid module
file was found directory. At line:1 char:1
+ Import-Module posh-docker
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (posh-docker:String) [Import-Module], FileNotFoundExc
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
From your question it sounds like you're following the instructions on this page, which read:
you can install the posh-docker PowerShell Module as follows:
(emphasis mine). Their wording is incorrect; those steps are for importing the module after it has been installed.
Instructions for installing the module are on the GitHub page for posh-docker. You must follow those instructions first:
Windows 10 / Windows Server 2016
- Open a powershell prompt
- Run
Install-Module -Scope CurrentUser posh-docker
Earlier Windows versions
- Install PackageManagement PowerShell Modules Preview
- Open a powershell prompt
- Run
Install-Module -Scope CurrentUser posh-docker
One thing I'd recommend, if you're on an earlier Windows version: instead of installing PackageManagement separately, just install Windows Management Framework 5.0 that way you get all of PowerShell 5.
As of this writing it's the latest stable, but next month (January 2017) WMF 5.1 is supposed to be released, FYI.