TestNetFxInstall is a powershell module to detect .net framework installation by checking windows registry values, and it support detecting .net framework version from 1.0 to 4.7. It is inspired by this MSDN Blog Post.
Clone TestNetFxInstall repository to
git clone https://github.com/MingMZ/TestNetFxInstall.git %UserProfile%\Documents\WindowsPowerShell\Modules\TestNetFxInstall
Then from the powershell prompt, type
Import-Module TestNetFxInstall
Once TestNetFxInstall module is imported into powershell, these additional cmdlets will be available to you current powershell session:
- Test-NetFx10Install
- Test-NetFx11Install
- Test-NetFx20Install
- Test-NetFx30Install
- Test-NetFx35Install
- Test-NetFx40ClientInstall
- Test-NetFx40FullInstall
- Test-NetFx45Install
- Test-NetFx451Install
- Test-NetFx452Install
- Test-NetFx46Install
- Test-NetFx461Install
- Test-NetFx462Install
- Test-NetFx47Install
- Get-NetFxInstalled
To check if .net framework 3.5 is installed
if (Test-NetFx35Install) { Write-Output ".Net 3.5 is installed" }
else { Write-Output ".Net 3.5 is not installed" }
To list all .net frameworks installed
Get-NetFxInstalled
Thanks Aaron Stebner for providing .net framework installation registry information.