DWord Reg key creation

Topics: Archive - General
Nov 25, 2014 at 9:27 PM
Ok so when I create a registry key with the following it does not seem to create the type any thoughts?

If ($psArchitecture -eq "x64") {
               Set-RegistryKey -Key  "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Google\Update\UpdateDefault" -Value "0" -Type 'DWord'  
               } 

              ElseIf ($psArchitecture -eq "x86") {
                Set-RegistryKey -Key  "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update\UpdateDefault" -Value "0" -Type 'DWord'            
                }
Developer
Nov 25, 2014 at 9:41 PM
What does the log file show for this operation?
Nov 26, 2014 at 2:26 PM
it says it is successful and creates the key just not the type and value.
Developer
Nov 26, 2014 at 8:36 PM
Edited Nov 26, 2014 at 8:37 PM
I was trying to ask if you could show the actual lines from the log file. It's easier to help if we can see the actual logging for future reference.

I ran the code you posted myself and you're not calling the function correctly.

This is what it should look like:
If ($psArchitecture -eq "x64") {
    Set-RegistryKey -Key  "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Google\Update" -Name "UpdateDefault" -Value "0" -Type 'DWord'
}
ElseIf ($psArchitecture -eq "x86") {
    Set-RegistryKey -Key  "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update" -Name "UpdateDefault" -Value "0" -Type 'DWord'
}