Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

recurse through powershell object

Tags:

powershell

i am trying to browse through result i received from a command, Problem is when i access property i get only property name not corresponding path.

enter image description here

$com1 = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall*' | ? { $_ -match "Firefox" }

Command i tried to recurse:
$prop = $com1 | Select-Object  'Property' # Select only item property

then i get result without any mapping of property values.

result i get pasted below

Property                                        
--------                                               
{Comments, DisplayIcon, DisplayName, DisplayVersion...}

i expect to get value of comments and displayicon as i get in the image in the first time.

like image 887
Ardra Madhu Avatar asked Dec 17 '25 14:12

Ardra Madhu


1 Answers

Use Get-ItemProperty to get the actual property values from registry keys:

$PropertyValue = ($com1 | Get-ItemProperty -Name "property").property
like image 182
Mathias R. Jessen Avatar answered Dec 20 '25 09:12

Mathias R. Jessen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!