retrieving Value.Property value from hashtable

This topic contains 2 replies, has 2 voices, and was last updated by  Virgil Paul Hartline 2 weeks, 2 days ago.

  • Author
  • #103792

    This code will give me a hashtable
    $fff = Get-ChildItem "HKLM:Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" -Recurse|Select-Object *|Group-Object PSChildName -AsHashTable -AsString

    Return snipet:
    Property : {Inno Setup: Setup Version, Inno Setup: App Path, InstallLocation, Inno Setup: Icon Group...}
    PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Skype_is1
    PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
    PSChildName : Skype_is1
    PSDrive : HKLM

    I want to return the DisplayName value from Property. How?
    Will eventually retrieve all entries but for testing have simplified it to
    $fff.'7-Zip'.Property.GetValue('DisplayName') AND .Item('DisplayName')

    thank you

  • #103793


    I am not sure I understand exactly what you are after – as when I ran your code, I did not get the same "return snippet" you mention above –

    However – would this work for you?



    • #103795

      As it turns out the Property did not contain any values, just the listing of all the registry data
      I had to do the following
      $fff.GetEnumerator() | ForEach-Object{
      Get-ItemProperty -Path "registry::$(Convert-Path $_.Value.PSPath)"|Select-Object -ExpandProperty 'DisplayName'

You must be logged in to reply to this topic.