1

我有以下注册路径并且我知道它存在,我在这里做错了吗?!

$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.
4

1 回答 1

1

在我的机器上,该密钥存在于 HKCU 和 HKU,而不是 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

于 2013-08-22T11:47:36.477 回答