I'm trying to run reports of software our users will get on new computers. I have one list "Reference Software", which is all the software they currently have installed. Then another list, "Difference Software", which is all the software in our company that we have to manually install. I'm trying to compare these two lists and output what items are in both lists. Looking this up for weeks now, I've taken what others have suggested and try to make it work, but nothing yet.
Has anyone done something similar and got it to work???
$ComputerName = get-content c:\temp\ComputerList.txt
Get-InstalledSoftware $ComputerName | Out-File -FilePath C:\Temp\DifferenceSoftware.csv
$Path = "C:\Temp"
$DifferenceSoftware = Import-Csv -Path "$($path)\DifferenceSoftware.csv"
$ReferenceSoftware = Import-Csv -Path "$($path)\ReferenceSoftware.csv"
$combine = @()
foreach ($first in $DifferenceSoftware) {
foreach ($second in $ReferenceSoftware) {
if ($second -eq $first) {
$match = New-Object PSObject
$match | Add-Member Noteproperty $first
$combine += $match
}
}
}
$combine | Export-Csv -Path "$($path)\combined.csv"
Get-InstalledSoftware $ComputerName | Export-Csv ...instead ofGet-InstalledSoftware $ComputerName | Out-File ...right?