Powershell get-itemproperty未返回所有属性

Powershell get-itemproperty未返回所有属性,powershell,Powershell,希望你能帮忙 执行下面的powershell(顺便说一句,我是新手)以获取注册表项的值,当我执行第一个powershell语句时,我会获得我期望的所有属性,但当我针对VisualStudio\10.0执行第二个语句时,它不会返回任何属性,即使在注册表编辑器中有一组属性(包括我正在追逐的InstallDir!)盯着我的脸。你能帮忙吗 谢谢 PS C:\DEV\GeoMet> Get-ItemProperty -path HKLM:\SOFTWARE\Microsoft\Windows\Cur

希望你能帮忙

执行下面的powershell(顺便说一句,我是新手)以获取注册表项的值,当我执行第一个powershell语句时,我会获得我期望的所有属性,但当我针对VisualStudio\10.0执行第二个语句时,它不会返回任何属性,即使在注册表编辑器中有一组属性(包括我正在追逐的InstallDir!)盯着我的脸。你能帮忙吗

谢谢

PS C:\DEV\GeoMet> Get-ItemProperty -path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion


    PSPath                   : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
    PSParentPath             : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
    PSChildName              : CurrentVersion
    PSDrive                  : HKLM
    PSProvider               : Microsoft.PowerShell.Core\Registry
    SM_GamesName             : Games
    SM_ConfigureProgramsName : Set Program Access and Defaults
    CommonFilesDir           : C:\Program Files\Common Files
    CommonFilesDir (x86)     : C:\Program Files (x86)\Common Files
    CommonW6432Dir           : C:\Program Files\Common Files
    DevicePath               : C:\Windows\inf
    MediaPathUnexpanded      : C:\Windows\Media
    ProgramFilesDir          : C:\Program Files
    ProgramFilesDir (x86)    : C:\Program Files (x86)
    ProgramFilesPath         : C:\Program Files
    ProgramW6432Dir          : C:\Program Files


PS C:\DEV\GeoMet> Get-ItemProperty -path HKLM:\SOFTWARE\Microsoft\VisualStudio\10.0
PS C:\DEV\GeoMet> 

这是我在regedit上看到的:

因此,您从
get ItemProperty
获得的输出是正确的。对于您提到的其他路径,您将看到有很多值


您可以使用
Get ChildItem
cmdlet获取10.0下看到的调试器等。您几乎肯定看到的是64位机器上的32位reg配置单元。请仔细检查您的regedit路径-它真的是
HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0

我在32位键中看到属性(例如InstallDir),但在64位键中看不到

如果是这样,这将是正确的查询:

Get-ItemProperty -path HKLM:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0

我想你明白了。电池没电了,所以不能尝试,但一切都有道理!谢谢。