If you try creating "foo" under HKLM in regedit, you will get a error
message saying "Cannot create key: Error writing to the registry."
I agree the error message from PowerShell could be better. Please bug this.
Thanks.
--
Wei Wu [MSFT]
Windows PowerShell Team
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"dreeschkind" <dreeschkind@discussions.microsoft.com> wrote in message
news:A727F521-9D4F-4FAB-A825-BD9A61B90F04@microsoft.com...
>I got a quite meaningless error message just saying 'wrong parameter' when
> trying to create a subkey of HKLM. Creating the same subkey in
> HKLM:\software
> works.
>
>
> PoSh 71 [42/25] C:\>new-item -path "hklm:\" -name foo
> New-Item : Falscher Parameter.
> At line:1 char:9
> + new-item <<<< -path "hklm:\" -name foo
>
>
>
>
> PoSh 72 [42/25] C:\>new-item -path "hklm:\software" -name foo
>
>
> Hive: Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software
>
> SKC VC Name Property
> --- -- ---- --------
> 0 0 foo {}
>
>
> --
> greetings
> dreeschkind