无法在PowerShell Core 7.0.3上安装NuGet软件包提供程序

问题描述

我在 Ubuntu 18.04上有一个PowerShell Core 7.0.3

尝试使用以下命令安装 NuGet 时,出现错误

PS /home/adp/Downloads> Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-PackageProvider: Unable to find repository with SourceLocation ''. Use Get-PSRepository to see all available repositories.

Get-PSRepository命令也不起作用:

PS /home/adp/Downloads> Get-PSRepository 
Get-PackageSource: /home/adp/.local/share/powershell/Modules/powershellget/2.1.2/PSModule.psm1:9186
Line |
9186 |  … ckageSources = PackageManagement\Get-PackageSource @PSBoundParameters
     |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Unable to find module providers (powershellget).

并且Get-PackageProvider -ListAvailable不返回任何内容

我也尝试了this solution,但没有用。

我一直在解决问题,感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)