2016-12-27 201 views
4

Import-Module posh-docker是不工作的電源外殼,同時以管理員身份運行導入模塊豪華,碼頭工人不工作

我試圖使當前PowerShell命令自動完成,但得到以下錯誤。 executionpolicy已經設置爲RemoteSigned。我的系統中有Docker Toolbox。

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 

回答

8

從你的問題聽起來好像你下面the instructions on this page,其內容如下:

可以安裝豪華的-泊塢窗PowerShell的模塊如下:

(重點礦)。他們的措辭不正確;這些步驟用於模塊安裝後導入模塊。

安裝說明該模塊位於the GitHub page for posh-docker。您首先必須遵循這些指示:

的Windows 10/Windows的服務器2016

  1. 打開PowerShell提示符
  2. 運行Install-Module -Scope CurrentUser posh-docker

早期版本的Windows

  1. 安裝PackageManagement PowerShell Modules Preview
  2. 打開PowerShell提示符
  3. 運行Install-Module -Scope CurrentUser posh-docker

有一件事我會建議,如果您使用的是早期的Windows版本:不是單獨安裝PackageManagement,只需安裝Windows Management Framework 5.0這樣你得到所有的PowerShell 5.

在撰寫本文時,它是最新的穩定版本,但下個月(2017年1月)WMF 5.1應該發佈,僅供參考。

+0

是,其真正的..謝謝刪除C:\Users\[user]\Documents\WindowsPowerShell\modules\posh-docker\*

  • 運行Install-Module -Scope AllUsers posh-docker .. – Girish

  • 1

    接受的答案不適用於我。

    1. 從行政PowerShell的