Swisspick
Swisspick

Reputation: 25

Get IdentifyingNumber of Software in Powershell

I need the IdentifyingNumber of a certain Software as in ONLY the IdentifyingNumber.

Here is my code which finds the ID of a certain Software.

$k_agent_identifyingnumber = Get-WmiObject Win32_Product | Where-Object {$_.Name -like "*XY* *XY* *XY*"} | Select IdentifyingNumber

Write-Host $k_agent_identifyingnumber

Which gives me the result

@{IdentifyingNumber={XXXF24-88AB-45E1-A6E6-40C8278XXXX}}

Is it possible to remove the whole "@{IdentifyingNumber=} ???

Thanks for your help!

Upvotes: 1

Views: 4979

Answers (1)

vrdse
vrdse

Reputation: 3154

You need to expand the property, to only return the property value.

Select-Object -ExpandProperty IdentifyingNumber

Upvotes: 3

Related Questions