Fixed an error in Compare-Worksheet when only 1 row is different

This commit is contained in:
jhoneill
2018-05-14 14:21:49 +01:00
parent bf8e8ed6bf
commit 807990c4ba

View File

@@ -135,7 +135,7 @@
if ($ExcludeDifferent -and -not $IncludeEqual) {$IncludeEqual = $true} if ($ExcludeDifferent -and -not $IncludeEqual) {$IncludeEqual = $true}
#Do the comparison and add file,sheet and row to the result - these are prefixed with "_" to show they are added the addition will fail if the sheet has these properties so split the operations #Do the comparison and add file,sheet and row to the result - these are prefixed with "_" to show they are added the addition will fail if the sheet has these properties so split the operations
$diff = Compare-Object -ReferenceObject $Sheet1 -DifferenceObject $Sheet2 -Property $propList -PassThru -IncludeEqual:$IncludeEqual -ExcludeDifferent:$ExcludeDifferent | [PSCustomObject[]]$diff = Compare-Object -ReferenceObject $Sheet1 -DifferenceObject $Sheet2 -Property $propList -PassThru -IncludeEqual:$IncludeEqual -ExcludeDifferent:$ExcludeDifferent |
Sort-Object -Property "_Row","File" Sort-Object -Property "_Row","File"
#if BackgroundColor was specified, set it on extra or extra or changed rows #if BackgroundColor was specified, set it on extra or extra or changed rows