Considering this was at least my tenth time packaging this dotnet installer for ConfigMgr, I figured I should share it here for safe keeping. Further help on PowerShell App Deployment Toolkit (https://psappdeploytoolkit.com/). I will not be covering how to use PSADT, just the guts.
Detection Method:
$netfx3 = Get-WindowsOptionalFeature -Online -FeatureName NetFx3
if ($netfx3.state -eq 'Enabled') { write-output 'netfx3 is enabled' }
PSADT install/uninstall command lines:
## <Perform Installation tasks here>
Enable-WindowsOptionalFeature -Online -FeatureName NetFx3 -All -LimitAccess -Source $dirFiles
# <Perform Uninstallation tasks here>
Disable-WindowsOptionalFeature -Online -FeatureName NetFx3
Source files need to be pulled from latest ISO (sources\sxs\) from MS:
- Microsoft-Windows-NetFx3-OnDemand-Package~31bf3856ad364e35~amd64~en-US~.cab
- microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab
Lastly, here is the completed package, but be warned the links may not stay alive for long.
- https://github.com/brianfgonzalez/Scripts/blob/master/dotnet35_forwin10.7z.001
- https://github.com/brianfgonzalez/Scripts/blob/master/dotnet35_forwin10.7z.002
- https://github.com/brianfgonzalez/Scripts/blob/master/dotnet35_forwin10.7z.003
- https://github.com/brianfgonzalez/Scripts/blob/master/dotnet35_forwin10.7z.004
/Brian