首页 > 解决方案 > Powershell启动需要很长时间

问题描述

这是一个奇怪的问题。我敢肯定这在两个月前工作得很好,现在突然就这样了。当我启动 powershell (直接从开始菜单或从 cmd。是否以管理员身份启动)时,我得到以下几行:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6

然后它被冻结超过 30 秒,然后,我得到命令行和光标,我可以写

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\user>

我在互联网上进行了很多搜索,但所有使用某些命令的解决方法都没有帮助。最后,所有的讨论要么太老了,这可能是新的。知道会出什么问题吗?我没有安装任何只是 Windows 更新的东西(但更多,并且不确定它什么时候开始表现得像这样。我在 windows 10 pro 最新更新上

非常感谢马雷克的任何提示

标签: windowspowershell-2.0

解决方案


在使用 procmon(sysinternals 工具)分析 powershell.exe 之后,我可以看到该进程正试图在 catroot2 文件夹中执行某些操作,因此在重命名它之后(您必须停止阻止该文件夹的 CryptSvc 服务),它是自动创建的。所以结论是该文件夹已损坏。(对不起,我的英语不好)

执行下一个 .bat

net stop CryptSvc /y
rename c:\windows\system32\catroot2 Catroot2.bak
net start CryptSvc

推荐阅读