【发布时间】:2019-01-27 23:42:06
【问题描述】:
由于某种原因,我安装的 Windows 10/Powershell 5.0 似乎缺少Certificate Provider。似乎我什至没有 Microsoft.PowerShell.Security 模块,默认情况下应该与 powershell 一起安装并包含证书提供程序。这是我在运行 Get-Module 时得到的(我前段时间添加了 post-git,也许我这样做时搞砸了?):
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script 0.7.1 posh-git {Add-PoshGitToProfile, Add-SshKey, Enable-GitColors, Get-A...
Script 1.2 PSReadline {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PS...
这是我运行 Get-PSProvider 时得到的结果:
Name Capabilities Drives
---- ------------ ------
Registry ShouldProcess, Transactions {HKLM, HKCU}
Alias ShouldProcess {Alias}
Environment ShouldProcess {Env}
FileSystem Filter, ShouldProcess, Credentials {C, D, E}
Function ShouldProcess {Function}
Variable ShouldProcess {Variable}
我是否可以重新安装 PowerShell 或将此提供程序/驱动器添加到我的构建中而无需完全重新安装 Windows?我的机器似乎发生了一些非常可疑的事情,如果不是绝对必要的话,我真的不想完全重新安装。
【问题讨论】:
-
我得到了和你一样的模块和提供者,这很正常,你得到的是你做
ls cert:吗? -
还有这个:
Get-PSProvider -PSProvider Certificate | fl *? -
Get-PSProvider -PSProvider Certificate | fl * Get-PSProvider : Cannot find a provider with the name 'Certificate'. At line:1 char:1 + Get-PSProvider -PSProvider Certificate | fl * + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Certificate:String) [Get-PSProvider], ProviderNotFoundException + FullyQualifiedErrorId : ProviderNotFound,Microsoft.PowerShell.Commands.GetPSProviderCommand -
ls cert: ls : Cannot find drive. A drive with the name 'cert' does not exist. At line:1 char:1 + ls cert: + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (cert:String) [Get-ChildItem], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand -
您应该能够在您的 Windows 安装上运行恢复来解决问题。
标签: powershell windows-10 certificate powershell-5.0