Compare Master file and output files

I am trying to compare a Master Template to a CSV file that is ran daily to check if such machines are getting backed up or not and than output the file with the machines not getting backed up. I have tried the compare cmdlet in PowerShell and I don't get an accurate read.

$BaseCSV=import-csv .\documents\reports\Odin.csv

$NewCSV=import-csv .\Documents\Reports\thor.csv

Compare-Object -ReferenceObject $BaseCSV -DifferenceObject $NewCSV -IncludeEqual -property Node | Where { $_.SideIndicator -eq '=>' -or $_.SideIndicator -eq '==' } | export-csv .\Documents\Reports\Results\data.csv -NoTypeInformation

I have also tried to link my PowerShell commands to my sql database to try and compare the differences but I'm getting no where. I'm new to trying to compare this but any help would be great.

Parents
  • You are not providing enough info to go on.

     

    What does this Master Template and CSV look like

     

    What does this …

     

    ‘I have tried the compare cmdlet in PowerShell and I don't get an accurate read.’

     

    … mean? What are you expecting? You don’t show that either.

     

    Ditto on this…

     

    ‘I have also tried to link my PowerShell commands to my sql database to try and compare the differences’

     

    … how, does this SQL thing effort have anything to do with the Master Template and CSV?

    Is that where the Master Template and or CSV come from, etc…

Reply Children
No Data