2013-08-22 95 views
1

我有以下注册路径,我知道它的存在,我在这里做错了什么?!powershell阅读注册表

$path = 'Registry::HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000001' 
Get-ChildItem $path | Get-ItemProperty | Select-Object -ExpandProperty "Service Name" 

PSHELL回报:

Get-ChildItem : Cannot find path 'HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000001' 
because it does not exist. 
+1

您是否尝试在父文件夹上执行get-childitem? 00000001是否出现? – plunkets

回答

1

在我的机器在HKCU和香港大学,而不是HKLM该键存在。你可以试试这个:

$path = 'HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000001' 
Get-ItemProperty $path | Select-Object -ExpandProperty "Service Name" 

GET-ChildItem只返回注册表子项,因此它不会为这条路返回任何东西。 http://technet.microsoft.com/en-us/library/ee176852.aspx