Created
May 17, 2017 16:58
-
-
Save garethj-msft/b0a79d8d6368687cd9aaec92350b8751 to your computer and use it in GitHub Desktop.
PowerShell to turn off JIT optimization for all DLLs in a directory
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
$path = get-location | |
$files = get-Childitem $path -recurse -include *.dll | |
$content = "[.NET Framework Debugging Control]`r`nGenerateTrackingInfo=1`r`nAllowOptimize=0" | |
$count | |
foreach ($file in $files) | |
{ | |
if ($file.fullname.contains(".dll") -or $file.fullname.contains(".DLL")) | |
{ | |
$count++ | |
write-host ("{0:000#}:" -f $count) $file.fullname -NoNewline | |
$t = ($file.fullname -replace(".dll", "")) + ".ini" | |
} | |
if ($t -ne $null) | |
{ | |
$fileExists = Test-Path $t | |
if ($fileExists -eq $false) | |
{ | |
write-host " ==> created new ini" | |
out-file -filePath $t -inputobject $content | |
} | |
else | |
{ | |
write-host " ==> ini already exists" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment