我试图从注册表项中获取所有子注册表项
$Key="hklm:\SOFTWARE\Wow6432Node\MyCompany\MyProj"
$ComponentKeys=Get-ChildItem -path $Key
$ComponentName=$Components | Select-object Name
$ComponentName
它显示如下结果
Name
----
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Service
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\UserInterface
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\DataSetView
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Notification
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Model
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Management
但我只想检索子项名称而不是全名。
我需要如下结果
Name
----
Service
UserInterface
DataSetView
Notification
Model
Management
如何单独获取密钥名称?