Trying to create a registry and to assign its value but script gives an error

Hi All,

I am trying to create a reg and key and assign a value to it but the code is giving an error, can someone please suggest on it?

type $registrypath = "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node"
$Name = "Athena Project"
$Value = "RSCH"
New-ItemProperty -Path $registrypath -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Nullor paste code here

I ensured that the path I gave exist in the registry. Error screenshot

Fixed myself, ty!!

Great that you’ve found a solution yourself.

But please do not post images of code or console output. Instead post the plain text formatted as code.

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <---- Click :point_up_2:t4: :wink:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.