我在 Windows 10(版本 1703 - Creators Update)上遇到 powershell 提示启动缓慢的问题。
我的硬件规格(相当快的机器):英特尔 i5-7440HQ(四核)/32GB DDR4 RAM/512 三星 SSD 硬盘。
我试图绕过配置文件和执行策略,但它没有改变任何东西:
powershell -noprofile -ExecutionPolicy Bypass ( Measure-Command { powershell "Write-Host 1" } ).TotalSeconds
6,228067
我的朋友在没有 Creators Update 的情况下使用 Windows 10 的同一台笔记本电脑在不到 0.5 秒的时间内运行了 powershell。
还尝试使用 ngen.exe 进行一些编译,但没有帮助:
$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
[AppDomain]::CurrentDomain.GetAssemblies() | % {
if (! $_.location) {continue}
$Name = Split-Path $_.location -leaf
Write-Host -ForegroundColor Yellow "NGENing : $Name"
ngen install $_.location | % {"`t$_"}
}
Run Code Online (Sandbox Code Playgroud)
知道我该如何调查这个问题吗?
你好