I’m trying to extract the GUIDS from this list.
Get-WMIObject WIN32_Product | ? {$_.IdentifyingNumber -like “*26A24AE4-039D-4CA4-87B4-2F8321*FF*”} | Format-List IdentifyingNumber
is it possible to convert each item into a string and possibly assign them to variables?
Here’s what I was trying, but it’s not working. but maybe this will show the logic i am trying:
$A = Get-WMIObject WIN32_Product | ? {$_.IdentifyingNumber -like “*26A24AE4-039D-4CA4-87B4-2F8321*FF*”} | Format-List IdentifyingNumber
$GUIDList = ForEach-Object{$A.ToString()}
$GUIDList
Format-list is, as the name suggests, for display formatting purposes.
Based on your usage, I suppose you can use Select-Object instead:
After that you will have an array of objects with property IdentifyingNumbers.
If you just want array /list of strings ( assuming the property is string ) you could do: