I wonder if any of you good folks can help me please?
I have a SQL query that fills a table:
$DataAdapter = new-object System.Data.SqlClient.SqlDataAdapter $DataAdapter.SelectCommand = $PrinterSelectCmd $dataset = new-object System.Data.Dataset $DataAdapter.Fill($dataset) $PrinterXmlFile = $dataset.Tables
I then also have an array that has the locally installed printer information
$printer = Get-WmiObject Win32_Printer
Is there a quick, easy way to compare if any of the values in $PrinterXmlFile (eg the sharename) against $Printer, if they aren’t in $printer to then build a new list based on the objects that arent in $printer?