13 字
1 分钟
提高 PowerShell 启动速度
2026-02-03

提权的 powershell 中执行以下代码:

# Source - https://stackoverflow.com/a/59343705
# Posted by Theo
# Retrieved 2026-02-03, License - CC BY-SA 4.0
$env:PATH = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
[AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object {
$path = $_.Location
if ($path) {
$name = Split-Path $path -Leaf
Write-Host -ForegroundColor Yellow "`r`nRunning ngen.exe on '$name'"
ngen.exe install $path /nologo
}
}
提高 PowerShell 启动速度
https://nekoside.com/posts/提高-powershell-启动速度/
作者
nekoside
发布于
2026-02-03
许可协议
CC BY-NC-SA 4.0

目录