I am trying to determine if I can install .NET 3.5 Windows features on a random server (Windows 2016 onwards).
I found online that we can do Get-WindowsCapability -Online -Name NetFx3~~~~ (Source: https://woshub.com/how-to-install-net-framework-3-5-on-windows/)
Or we can do, (Get-ItemProperty -Path "HKLM:\SOFTWARE\MicrosoftNET Framework Setup\NDPv3.5").Version (source: https://www.danielengberg.com/install-net-framework-35/)
However, sometimes when I ran as administrator, Get-WindowsCapability -Online -Name NetFx3~~~~ I don't get PS C:\Windows\system32> Get-WindowsCapability -Online -Name NetFx3~~~~
Name : NetFX3~~~~ State : Installed DisplayName : .NET Framework 3.5 (includes .NET 2.0 and 3.0) Description : .NET Framework 3.5 (includes .NET 2.0 and 3.0) DownloadSize : 72354590 InstallSize : 253084958
but rather PS C:\Windows\system32> Get-WindowsCapability -Online -Name NetFx3~~~~
Name : State : NotFound DisplayName : Description : DownloadSize : InstallSize :
so would the registry key be enough to say I can install .Net 3.5 Windows features on the server? If it is the right value? Or Get-WindowsCapability should be more reliable and it could be something to do with the server that doesn't give me the right results?