Skip to content

Instantly share code, notes, and snippets.

@luke-beep
Created December 1, 2023 19:04
Show Gist options
  • Save luke-beep/076bed7078cd62e863685461efa60bcc to your computer and use it in GitHub Desktop.
Save luke-beep/076bed7078cd62e863685461efa60bcc to your computer and use it in GitHub Desktop.
$ngenPath = Join-Path ([Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()) "ngen.exe"
$assemblies = [AppDomain]::CurrentDomain.GetAssemblies() |
Where-Object { $_.GlobalAssemblyCache -and $_.Location }
foreach ($assembly in $assemblies) {
Start-Process -FilePath $ngenPath -ArgumentList "install `"$($assembly.Location)`"" -Wait -NoNewWindow
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment