Working with Registry Properties – NoteProperty

Welcome Forums General PowerShell Q&A Working with Registry Properties – NoteProperty

Viewing 6 reply threads
  • Author
    Posts
    • #154604
      Participant
      Topics: 3
      Replies: 43
      Points: 78
      Rank: Member

      Trying to find a version of Vmware software installed on a server. Using the following command to query the server’s registry I get the information needed. I just want two values, the name of the software and the version. This is contained in a noteproperty named property.

      This is the command I am using

      This is a sample of the output:

      How do I get the DisplayName and DisplayVersion from that NoteProperty? I will need to do this against a list of servers, but first I have to figure this step out. Any help is appreciated. And if you could explain why your suggestion works that would be helpful too.
      Thanks

    • #154608
      MvW
      Participant
      Topics: 11
      Replies: 13
      Points: 124
      Rank: Participant

      I use this

       

      Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
      ForEach-Object { Get-ItemProperty $_.pspath } |
      Where-Object {$_.Displayname -like ‘*citrix*’} |
      Select-Object PSChildName, DisplayName, DisplayVersion,UninstallString, PSPath |
      Sort-Object PSChildName, DisplayName, DisplayVersion,UninstallString, PSPath |Select-Object DisplayName, DisplayVersion | Format-List

    • #154614
      MvW
      Participant
      Topics: 11
      Replies: 13
      Points: 124
      Rank: Participant

      orĀ  this

       

      Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
      ForEach-Object { Get-ItemProperty $_.pspath } |
      Where-Object {$_.Displayname -like ‘*citrix*’} |
      Select-Object PSChildName, DisplayName, DisplayVersion,UninstallString, PSPath |
      Sort-Object PSChildName, DisplayName, DisplayVersion,UninstallString, PSPath | Select-Object -expand DisplayName

    • #154616
      js
      Participant
      Topics: 32
      Replies: 852
      Points: 2,780
      Helping Hand
      Rank: Community Hero

      You can go straight to get-itemproperty with a wildcard:

    • #154619
      Participant
      Topics: 3
      Replies: 43
      Points: 78
      Rank: Member

      Thank you. Works like a charm!
      Now I have to look at each line and figure out what is happening under the covers
      Much appreciated

    • #154620
      Participant
      Topics: 2
      Replies: 513
      Points: 1,322
      Helping Hand
      Rank: Community Hero

      The simplest way is to pipe the result into Get-ItemProperty to translate the registry item into a more standard PowerShell object with easily-accessible properties. From there, you can use Select-Object -Property to trim down the properties to just the ones you’re interested in.

    • #154628
      Participant
      Topics: 0
      Replies: 113
      Points: 590
      Helping Hand
      Rank: Major Contributor

      or

      The Get-ItemProperty works better with the registry and get all of the properties of the give path in a readable format. Then you can use Select-Object to output the properties to the console.

      pwshliquori

Viewing 6 reply threads
  • The topic ‘Working with Registry Properties – NoteProperty’ is closed to new replies.