I’m trying to do a Set-RegistryKey for the logged on user, but i dont get it run with the invoke command
when i put the following lines in the script i get an error during the installation that SID can not be NULL (or similar message):
You need to define the $HKCURegistrySettings script block with your HKCU operations before passing it to Invoke-HKCURegistrySettingsForAllUsers, $UserProfile.SID would only be available in that scriptblock hence the ‘cannot be NULL’ exception, here’s how I’ve used it in the past: