I am looking to list out DLLs in debug mode in current folder using powershell script. is it possible to do so, can you please help in preparing the script.
thanks you @Moerwald. based on your script and reference provided, have expanded it to run for all DLLs in given folder recursively. you may have a look at it please.
Get-ChildItem -Filter *.dll -Recurse |
ForEach-Object {
$AssemblyName= $_.FullName;
try {
$Assembly = [Reflection.Assembly]::LoadFile($AssemblyName);
$type = [System.Type]::GetType("System.Diagnostics.DebuggableAttribute");
$debugAttribute = $Assembly.GetCustomAttributes($type,$false);
If ($debugAttribute.count -Eq 0) {} #{$_.Name + ":Release"}
Elseif ($debugAttribute[0].IsJITOptimizerDisabled -eq $false) {} #{$_.Name + ":Release"}
Else {$_.Name + ":Debug"}
} catch{ "***ERROR*** Error when loading assembly: " + $AssemblyName + $_.Exception.Message}
}