答案1
我之前已经安装过鍵盤它覆盖了我的版本Install-Module
。您可以通过运行来检查help install-module
它引用的是哪个版本。
我找不到 PSGet 的卸载文档,因此我通过删除文件夹将其删除C:\Users\Rory\Documents\WindowsPowerShell\Modules\PSGet
。现在help install-module
指的是微软版本。
答案2
你可以通过以下方式解决冲突在命令前加上模块名称:
PsGet 安装并妨碍:
C:\repos> install-module csproj
Module csproj was not found in central repository
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:694 char:13
+ throw "Module $Module was not found in central repository ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Module csproj w...tral repository:String) [], RuntimeException
+ FullyQualifiedErrorId : Module csproj was not found in central repository
使用限定名称:
C:\repos> powershellget\install-module csproj
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running
the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y
C:\repos>
谢谢http://windowsitpro.com/blog/dealing-cmdlet-name-conflicts
通过读取文档的 URL 获取模块名称 -https://msdn.microsoft.com/powershell/reference/5.1/PowerShellGet/install-module
更多信息:https://andrwwatt.wordpress.com/2006/05/13/coping-with-a-powershell-naming-clash/