I'm trying to Run Advertised Programs using PowerShell
$tpObject = Get-WmiObject -Namespace ROOT\ccm\Policy\Machine\ActualConfig -Class CCM_SoftwareDistribution `
| Select-Object -Property PKG_Manufacturer, PKG_Name, PKG_MIFVersion
The output will be:
PKG_Manufacturer PKG_Name PKG_MIFVersion
---------------- -------- --------------
Microsoft Word v1234
Google Chrome v987
Microsoft Excel v987
etc
How do I concatenate it into a string? I tried this:
[string[]]$result = $tpObject.PKG_Manufacturer + $tpObject.PKG_Name + " - " + $tpObject.PKG_MIFVersion
$result
But it display all the PKG_Manufacturer, then PKG_Name, then PKG_MIFVersion
I would like it to display this, Microsoft Word - v1234 as a string?
Any suggestions or comments would be greatly appreciated.
tks