Last active
April 8, 2024 20:29
-
-
Save dyavuz/e58e839464f1e66206dd318229a29224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/a/59343705 | |
$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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$VcRedists = [ordered]@{ | |
"2005" = "/Q" | |
"2008" = "/q" | |
"2010" = "/q /norestart" | |
"2012" = "/install /quiet /norestart" | |
"2013" = "/install /quiet /norestart" | |
"2015+" = "/install /quiet /norestart" | |
} | |
foreach ($VcRedistYear in $VcRedists.Keys) { | |
foreach ($Arch in "x86", "x64") { | |
& winget install --accept-source-agreements --accept-package-agreements --exact "Microsoft.VCRedist.${VcRedistYear}.${Arch}" --override $VcRedists.$VcRedistYear | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable Windows Defender within Safe Boot | |
$WdServices = $( | |
"MDCoreSvc" | |
"SecurityHealthService" | |
"WdNisSvc" | |
"WinDefend" | |
"wscsvc" | |
) | |
foreach ($WdService in $WdServices) { | |
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\$WdService" -Name "Start" -PropertyType DWord -Value 4 -Force | Out-Null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment