$Path = "Registry::HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\Test1\Test2\Test3\Test4"
New-Item -Path $Path
Getting below error
New-Item : The registry key at the specified path does not exist
The form of the registry path is wrong. Use the following:
$Path = "HKLM:\Software\ODBC\ODBC.INI\Test1\Test2\Test3\Test4"
New-item -Path $Path -Force
As i see you are creating more than one sub dir, thats why you will need -Force switch. Using reg dirs in powerhsell
Hkey local machine = HKLM Hkey current user = HKCU Etc.