2012-08-30 40 views
0

希望你能幫助...得到-itemproperty不返回所有屬性

執行下面的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> 

回答

1

您幾乎可以肯定地看到在64位機器上的32位 reg hive。仔細檢查你的註冊路徑 - 它真的是HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0

我在32位密鑰中看到屬性(例如InstallDir),但沒有看到64位密鑰。

這將是適當的查詢,如果這樣:

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

我認爲我對你給它。電池耗盡,所以不能嘗試,但這一切都有道理!謝謝。 – TimmyD

0

這是我看到的註冊表編輯器:

enter image description here

所以,你從Get-ItemProperty得到的輸出是正確的。對於您提到的另一條路徑,您會看到有很多值。

您可以通過使用Get-ChildItem cmdlet來獲得10.0之類的調試器等。

相關問題