retrieving Value.Property value from hashtable

Welcome Forums General PowerShell Q&A retrieving Value.Property value from hashtable

This topic contains 2 replies, has 2 voices, and was last updated by

10 months, 2 weeks ago.

  • Author
  • #103792

    Topics: 2
    Replies: 1
    Points: 0
    Rank: Member

    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

    Topics: 14
    Replies: 38
    Points: 117
    Rank: Participant

    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

      Topics: 2
      Replies: 1
      Points: 0
      Rank: Member

      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'

The topic ‘retrieving Value.Property value from hashtable’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort