How to find .NET Framework version using PowerShell

Posted by in PowerShell

Often times when I am getting ready to install Exchange 2016 or Exchange 2013, I look at pre-requisites and wonder if correct version of .NET Framework is already installed on the server or not. It certainly saves me time if it is already installed and depending on status of latest OS patch installation, it is highly likely that the required framework is already installed.

I think I have written a script in past but never published it. And can’t find anymore. So I just searched and found a script from Joel Bennett (@jaykul) which I think is simple and gets me the information I need. I also added reference of .Net Framework version numbers listed on this MSDN article:

And for benefit of those who end up on this page, I am posting the lightly modified script here:

#All Credits to @JayKul for script posted on
function Get-FrameworkVersions()
Write-Host ""
Write-Host "Version Table on MSDN:"
Write-Host "Release 379893 is .NET Framework 4.5.2" -ForegroundColor "Yellow"
Write-Host ""
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version,Release -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version, Release


Print Friendly