This is a quick one – an improvement on an almost perfect script that doesn’t quite work how it should.
the script Set-RegistryValueForAllUsers.ps1 found on the TechNet Gallery has one major fault.
If you try and apply more than one value at a time, the last applied value is overwritten, leaving you at the end of the script with the last value and nothing else. Very simple change, but now the script works as intended.
I’ll be reaching out to the author later to see if we can get this rectified, but as there are many comments on the TechNet script page covering this, I figured I’d just put the fixed code up here for others to view.
As always, a copy of this code is available on my GitHub repository.