I have a question please - I have a .reg file I want to merge after an installer - so I have added the below command to run below the installer. But it doesn’t add the .reg file to the device’s registry.
Could someone advise if I am doing something wrong with the command I am using?
The way you wrote the command will only work if $dirSupportFiles does not contain spaces. I added escaped double quotes for that path.
-Passthru will return the Exitcode, STDOUT, and STDERR in an array. You didn’t have an array so I added $Results
I think the Exitcode, STDOUT, and STDERR will got to the PSADT log file regardless.
Also the REG file will work as expected if all the lines are for HKLM hive.
If you have HKCU lines in the REG file, then I think the Default User hive gets the changes when you run as SYSTEM, not the current user.