Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi

for a Software prerequisite check

I need to check .Net 3.5 and .Net 4.5 framework and feature.

for Checking 3.5 I am using Below powershell command


Get-WindowsFeature | ? {$_.Name -eq 'NET-Framework-Core'} | ForEach-Object {$_.Installed}


And For checking 4.5 I am using

Get-WindowsFeature | ? {$_.Name -eq 'NET-Framework-45-Core'} | ForEach-Object {$_.Installed}


Both Works fine on Windows server above than 2008.
But On Windows 2008R2 server 4.5 is returning False.

What I have tried:

However I checked on 2008r2 server .net framework 4.5 is present in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client

Release No: 378389 which means framework 4.5

Is there any way by which i can check both framework on both machine with a unique command.

Thanks in advance
Posted
Updated 26-Jun-18 7:52am

Check the install folders:

C:\Windows\Microsoft.NET\Framework
 
Share this answer
 
Comments
Richard Deeming 26-Jun-18 13:51pm    
That probably won't work - 4.5 installs into the same folder as 4.0, as does 4.6, 4.7, ...
[no name] 26-Jun-18 17:34pm    
4.x is an "update" ... there are no multiple (physical) versions of 4.x. (4.5 will clobber 4.7).

The "file version" will give the product version. The assumption is that a "higher" version framework will handle a lower targeted app.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900