提高 PowerShell 启动速度

58 字
1 分钟
提高 PowerShell 启动速度

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

# Source - https://stackoverflow.com/a/59343705
# Posted by Theo
# Retrieved 2026-06-24, 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/optimize-pwsh-startspeed/
作者
nekoside
发布于
2026-02-03
许可协议
CC BY-NC-SA 4.0

当前页面没有目录

文章目录

当前页面没有目录