小编Kil*_*ian的帖子

损坏的包管理器?无法找到模块提供程序 (PowerShellGet)

这是我在互联网上找到的常见解决方案无法解决的常见错误。

无法运行 Get-PsRepository、Install-Module 和相关 (OneGet?) 命令,否则它们会抛出“无法找到模块提供程序 (PowerShellGet)”错误。这似乎是 NuGet 包管理器模块的问题,但我不知道如何恢复。安装的包提供程序似乎有效

症状模式:
C:> [Net.ServicePointManager]::SecurityProtocol

Tls12
Run Code Online (Sandbox Code Playgroud)

获取-PSRepository

PackageManagement\Get-PackageSource : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4496 char:31
+ ... ckageSources = PackageManagement\Get-PackageSource @PSBoundParameters
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power...etPackageSource:GetPackageSource) [Get-PackageSource
   ], Exception
    + FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageSource
Run Code Online (Sandbox Code Playgroud)

注册-PSRepository -Default -Verbose

VERBOSE: PowerShell meta provider initialization failed.
VERBOSE: No match was found for the specified search criteria and provider name 'PowerShellGet'. Try
'Get-PackageProvider -ListAvailable' to see if the provider exists on the …
Run Code Online (Sandbox Code Playgroud)

windows powershell oneget

4
推荐指数
1
解决办法
1435
查看次数

标签 统计

oneget ×1

powershell ×1

windows ×1