I am new to Powershell and I am having trouble with the following. I need to run a Get-WmiObject command and get programs and versions. Here is the code:
Get-WmiObject -Class Win32_Product | where Name -eq "Microsoft Policy Platform" | select Name, Version >> c:\Temp\PRograms.txt ;
Get-WmiObject -Class Win32_Product | where Name -eq "Mitel Connect" | select Name, Version >> c:\Temp\PRograms.txt
I get this output:
Name Version
---- -------
Microsoft Policy Platform 68.1.1010.0
Name Version
---- -------
Mitel Connect 214.100.1252.0
What I am hoping to get is:
Name Version
---- -------
Microsoft Policy Platform 68.1.1010.0
Mitel Connect 214.100.1252.0
I have tried making it 1 line, separate commands, google and looking at like scripts with no luck. I am hoping someone can point me in the right direction so I can build on it.