修复Conda导致的PowerShell启动缓慢
问题背景 最近发现我的 PowerShell 启动异常缓慢,从正常的瞬间启动延长到了 5~7 秒。作为经常要使用到的使用终端,每次启动都要被硬控好几秒不能使用,这严重影响了效率。 问题诊断过程 性能测量 首先使用 Measure-Command 测试正常启动时间: Terminal window Measure-Command { pwsh.exe -Command "exit" } Terminal window PS C:\Users\Alaye> Measure-Command { powershell -Command "exit" } Days : 0 Hours : 0 Minutes : 0 Seconds : 5 Milliseconds : 859 Ticks : 58595344 TotalDays : 6.78186851851852E-05 TotalHours : 0.00162764844444444 TotalMinutes : 0.0976589066666667 TotalSeconds : 5.8595344 TotalMilliseconds : 5859.5344 5s 测试无配置文件启动时间: Terminal window Measure-Command { powershell -NoProfile -Command "exit" } Terminal window ...