Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get-ChildItem doesn't work properly on Registry Provider

277 views
Skip to first unread message

BJ

unread,
Jan 10, 2009, 10:54:27 AM1/10/09
to
When i Invoke this Command on a german XP with Powershell V2 CTP3

Get-ChildItem HKLM: -recurse -include Powershell

I get this erros:

Get-ChildItem : Der angeforderte Registrierungszugriff ist unzulässig.
At line:1 char:14
+ Get-ChildItem <<<< HKLM: -recurse -include Powershell
+ CategoryInfo : PermissionDenied: (HKEY_LOCAL_MACHINE\SAM
\SAM:String) [Get-ChildItem], SecurityException
+ FullyQualifiedErrorId :
System.Security.SecurityException,Microsoft.PowerShell.Commands.GetChildItemCommand

Get-ChildItem : Der angeforderte Registrierungszugriff ist unzulässig.
At line:1 char:14
+ Get-ChildItem <<<< HKLM: -recurse -include Powershell
+ CategoryInfo : PermissionDenied: (HKEY_LOCAL_MACHINE
\SECURITY:String) [Get-ChildItem], SecurityException
+ FullyQualifiedErrorId :
System.Security.SecurityException,Microsoft.PowerShell.Commands.GetChildItemCommand

Get-ChildItem : Cannot process argument because the value of argument
"path" is invalid. Change the value of the "path" argument and run the
operation a
gain.
At line:1 char:14
+ Get-ChildItem <<<< HKLM: -recurse -include Powershell
+ CategoryInfo : InvalidArgument: (:) [Get-ChildItem],
PSArgumentException
+ FullyQualifiedErrorId :
Argument,Microsoft.PowerShell.Commands.GetChildItemCommand


Without the -Include Parameter everything works fine....

Vadims Podans

unread,
Jan 10, 2009, 2:44:01 PM1/10/09
to
try -ea 0 (this means ErrorAction=silentlycontinue) switch in
Get-ChildItem. The problem is that -Recurse tryies to find PowerShell key in
every parent key, however you haven't read permissions on some keys (such
HKLM\SAM).

Get-ChildItem HKLM: -recurse -include Powershell -ea 0

--
WBR, Vadims Podans
PowerShell blog - www.sysadmins.lv

"BJ" <po...@watie.de> rakstīja ziņojumā
"news:24db9c1d-b7e0-47fd...@d42g2000prb.googlegroups.com"...

BJ

unread,
Jan 10, 2009, 3:54:29 PM1/10/09
to
On 10 Jan., 20:44, "Vadims Podans" <vpodans> wrote:
> try -ea 0 (this means  ErrorAction=silentlycontinue) switch in
> Get-ChildItem. The problem is that -Recurse tryies to find PowerShell key in
> every parent key, however you haven't read permissions on some keys (such
> HKLM\SAM).
>
> Get-ChildItem HKLM: -recurse -include Powershell -ea 0
>
> --
> WBR, Vadims Podans
> PowerShell blog -www.sysadmins.lv
>
> "BJ" <p...@watie.de> rakstīja ziņojumā

> "news:24db9c1d-b7e0-47fd...@d42g2000prb.googlegroups.com"...
>
>
>
> > When i Invoke this Command on a german XP with Powershell V2 CTP3
>
> > Get-ChildItem HKLM: -recurse -include Powershell
>
> > I get this erros:
>
> > Get-ChildItem : Der angeforderte Registrierungszugriff ist unzulässig.
> > At line:1 char:14
> > + Get-ChildItem <<<<  HKLM: -recurse -include Powershell
> >    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACHINE\SAM
> > \SAM:String) [Get-ChildItem], SecurityException
> >    + FullyQualifiedErrorId :
> > System.Security.SecurityException,Microsoft.PowerShell.Commands.GetChildIte­mCommand

>
> > Get-ChildItem : Der angeforderte Registrierungszugriff ist unzulässig.
> > At line:1 char:14
> > + Get-ChildItem <<<<  HKLM: -recurse -include Powershell
> >    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACHINE
> > \SECURITY:String) [Get-ChildItem], SecurityException
> >    + FullyQualifiedErrorId :
> > System.Security.SecurityException,Microsoft.PowerShell.Commands.GetChildIte­mCommand

>
> > Get-ChildItem : Cannot process argument because the value of argument
> > "path" is invalid. Change the value of the "path" argument and run the
> > operation a
> > gain.
> > At line:1 char:14
> > + Get-ChildItem <<<<  HKLM: -recurse -include Powershell
> >    + CategoryInfo          : InvalidArgument: (:) [Get-ChildItem],
> > PSArgumentException
> >    + FullyQualifiedErrorId :
> > Argument,Microsoft.PowerShell.Commands.GetChildItemCommand
>
> > Without the -Include Parameter everything works fine....- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

###########################
Thanks for the tip but i already tested this - same Error

Get-ChildItem : Cannot process argument because the value of argument
"path" is invalid. Change the value of the "path" argument and run the
operation a
gain.
At line:1 char:14

+ Get-ChildItem <<<< HKLM: -recurse -include Powershell -ea 0

bluefin

unread,
Jan 10, 2009, 5:35:19 PM1/10/09
to
It is working well in V2CTP2.


On Jan 11, 4:54 am, BJ <p...@watie.de> wrote:
> On 10 Jan., 20:44, "Vadims Podans" <vpodans> wrote:
>
>
>
>
>
> > try -ea 0 (this means  ErrorAction=silentlycontinue) switch in
> > Get-ChildItem. The problem is that -Recurse tryies to find PowerShell key in
> > every parent key, however you haven't read permissions on some keys (such
> > HKLM\SAM).
>
> > Get-ChildItem HKLM: -recurse -include Powershell -ea 0
>
> > --
> > WBR, Vadims Podans
> > PowerShell blog -www.sysadmins.lv
>

> > "BJ" <p...@watie.de> rakstîja ziòojumâ

Vadims Podans

unread,
Jan 10, 2009, 6:44:25 PM1/10/09
to
in CTP3 doesn't work. Looks like that here is a bug.

--
WBR, Vadims Podans
PowerShell blog - www.sysadmins.lv

"bluefin" <desertca...@gmail.com> rakstīja ziņojumā
"news:54efc3e5-e2ae-435b...@v5g2000prm.googlegroups.com"...

0 new messages