I want to be able to look for an installed program in powershell and output to a file the results. So far, I have something that will list the install programs, and select the string that has the name of the program, but I am not sure how to specify a text file for it to use for the list of systems, and a way to make it output cleanly.
Get-WmiObject -Class Win32_Product -cn $computernamehere | Select-Object -Property Name | Sort-Object Name | Select-String Vmware | Out-File C:\Users\ajstepanik\Desktop\installed_programs.txt
I would like it to output in a fashion like:
COMPUTER1 - VMware Horizon View Client
COMPUTER2 - VMware Horizon View Client
COMPUTER3 - VMware Horizon View Client
Currently it outputs:
@{Name=VMware Horizon View Client}
@{Name=VMware Horizon View Client}
@{Name=VMware Horizon View Client}