Currently I have an Application which uses .NET Framework 4.8. To run we are checking .NET Framework 4.8 installed or not in the machine. if framework is available then it will install in local machine. Which we are using the below powershell script.
$frameWorkVersion = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' -Name Release -ErrorAction SilentlyContinue
Checks for .Net FrameWork greater than or equal to 4.8
if($frameWorkVersion.Release -ge 528040 )
The problem here is we are installing some of the application remotely which does not require to install .NET 4.8 in the remote machine.
But, the above windows registry check is not reading only in local machine.In the remote installation it is looking into remote machine windows registry instead of local machine.
I am new to powershell script, Is any way to always ensure that reading windows registry entry to check .NET 4.8 installed or not in the local machine instead of remote machine?