Quantcast
Viewing all articles
Browse latest Browse all 24

Get .NET Framework Version of an assembly (dll/exe) using PowerShell

i just had to find the required framework version for a compiled .NET assembly (just to make sure, that the selected Application Pool in IIS was set to the righte Framework Version).

——–

$fileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
 Filter = 'Assemblies (*.dll & *.exe)|*.dll'
 MultiSelect = $true}
 [void]$fileBrowser.ShowDialog()
 $files = $fileBrowser.FileNames
  
 foreach($file in $files)
 {
 $version = [System.Reflection.Assembly]::ReflectionOnlyLoadFrom($file).ImageRuntimeVersion;
 echo "$($file) is using Framework: $version"
 }
 

————–


Viewing all articles
Browse latest Browse all 24

Trending Articles