I am trying to set the value of this local policy to "Enabled" and as well "Download repair content and optional features directly from Windows Update instead of Windows Server Update Services WSUS". The target is to set these values through the PowerShell
Failed Trials
I followed most of the articles that suggested adding the two keys (LocalSourcePath and RepairContentServerSource) under this path in the registry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing"
I monitored the registry and noticed there is a key "Group Policy Objects" created only when you open the Edit Group Policy mmc in this path "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion*" and a subtree gets created under it "{Random_GUID}Machine\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing*". Under the Servicing key there are entries added for "LocalSourcePath", "RepairContentServerSource" and "**del.UseWindowsUpdate" get created and set. I tried automating the opening "Edit Group Policy" and setting the values in the dynamic key that gets created. When checking the screen the values will show to be set but once I close the console and reopen the values get lost.
I set the values through the Edit Policy Group console and compared the registry keys before and after and yet didn't find one useful key related to such a change.
My target is to automate this setting to ensure the installation of the 3.5 framework which doesn't get installed with the latest delivered Windows 11 versions after applying the latest updates. With this setting the rest of my automated scripts for configuring the 3.5 Windows feature will work.
Appreciate your support