Unattended install of .net framework 4.6.2 using D

2019-07-07 17:13发布

问题:

I'm trying to install 4.6.2 on a number of servers in an automated way (no implementation of WSUS or otherwise). My goal was to leverage PowerShell DSC as we are configuring other aspects that way.

However, the resources I've tried (xHotfix from xWindowsUpdate and xPackage from xPSDesiredStateConfiguration) have failed. xHotfix says the downloaded files are invalid (from https://support.microsoft.com/en-us/kb/3151800) and the native Package and xPackage resources require a ProductId...which doesn't seem to be available either.

Has anyone successfully deployed 4.6.2 via PowerShell DSC that can provide some pointers?

回答1:

Borrowing from another SO question (Failure Installing DotNet 4.6.1 via Chocolatey using DSC cChocoPackageInstaller) I opted to develop a custom resource to handle this because I'm not a fan of script resources as they feel brittle...

Both options (using a script or using a script resource) would work as well. I just chose to develop a custom resource for more control.



回答2:

Generally speaking I've found the best fallback to be just using the script resource to do the install. Create a check script that checks the version of .NET and then a script to go ahead and do the install if it's not at 4.6.2 already. I use the same method to deploy .exe based application installers.