BCon995
BCon995

Reputation: 135

Powershell compare two CSV files, how do you make it case-insensitive?

I have two CSV files I am comparing, one has two columns, the second file has three. I am needing the output of all three columns from the input from the first CSV file.

The code I am currently using is as follows

$ErrStatus = Import-Csv .\StatusErrorResults.csv

$StatLibrary = Import-Csv .\Status_Library.csv

Compare-Object $StatLibrary $ErrStatus -Property Device,Status -IncludeEqual -ExcludeDifferent -PassThru | Select-Object \* -ExcludeProperty SideIndicator | Export-Csv -NoTypeInformation .\StatusErrorResultsFiltered.csv"

It is ignoring a section of the Status Library due to case sensitivity, how can I include regardless of case?

Upvotes: 1

Views: 231

Answers (1)

AdamL
AdamL

Reputation: 13181

Compare-Object is case-insensitive by default, but you have -CaseSensitive switch to change that.

Upvotes: 1

Related Questions