question

JamesJ-9502 avatar image
0 Votes"
JamesJ-9502 asked LimitlessTechnology-2700 answered

Needs to check .NET Framework 4.8 intalled or not in local server machine

Hi,
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 )
{
return $True
}

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?

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered

I'm sorry, but I am confused by your question. What exactly do you mean by "remote installation"? Are you running SCCM or PSExec to launch an install process on some machine?

The Get-ItemProperty cmdlet will read the registry of the machine where Powershell.exe is running. You can read the registry of some other machine by using Invoke-Command.

https://itfordummies.net/2016/09/06/read-remote-registry-powershell

Or you could use reg.exe and put the "\\MachineName\" in front of the key name.

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/reg-query

Perhaps you could clarify what process you have running on which machine.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello @JamesJ-9502,

The offline package can be used in situations in which the web installer cannot be used because of a lack of Internet connectivity. This package is larger than the web installer and does not include the language packs.

I recommend that you use the web installer instead of the offline installer for optimal efficiency and bandwidth requirements.

For more information about the various command-line options that are supported by this update, see the "Command-Line Options" section in the .NET Framework Deployment Guide for Developers. using below link

https://docs.microsoft.com/en-us/dotnet/framework/deployment/deployment-guide-for-developers



Hope this answers all your queries, if not please do repost back.
If an Answer is helpful, please click "Accept Answer" and upvote it : )

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.