I feel like I'm missing something obvious but my mind's gone blank.....
I have the following output
PS C:\Users\User1> $TargetComputers
ComputerName UninstallString
------------ ---------------
Server1 MsiExec.exe /I{A7E794A1-D6E9-43CC-9B69-DEB6B5A91EF9}
Server2 MsiExec.exe /I{36648B37-EA03-4349-8C49-C26032D06C61}
Server3 MsiExec.exe /I{36648B37-EA03-4349-8C49-C26032D06C61}
Server4 C:\Program Files\7-Zip\Uninstall.exe
Server5 MsiExec.exe /I{A7E794A1-D6E9-43CC-9B69-DEB6B5A91EF9}
Server6 MsiExec.exe /I{A7E794A1-D6E9-43CC-9B69-DEB6B5A91EF9}
Server7 {"D:\Program Files\7-Zip\Uninstall.exe", MsiExec.exe /I{36648B37-EA03-4349-8C49-C26032D06C61}}
Server8 MsiExec.exe /I{A7E794A1-D6E9-43CC-9B69-DEB6B5A91EF9}
Server9 MsiExec.exe /I{36648B37-EA03-4349-8C49-C26032D06C61}
How do I manipulate the UninstallString column to leave me just {GUID}, including literal path where specified, when I call $TargetComputers?
{, take the 2nd part, split on the}and take the 1st part. for the lines that don't start with 'MsiExec.exe`, you will need to adjust what part you take after the splits.