mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-15 07:43:23 +00:00
Fixed an error in Compare-Worksheet when only 1 row is different
This commit is contained in:
@@ -45,7 +45,7 @@
|
|||||||
This version of the previous command lightlights all the cells in lightgray and then sets the changed rows back to white; only
|
This version of the previous command lightlights all the cells in lightgray and then sets the changed rows back to white; only
|
||||||
the unchanged rows are highlighted
|
the unchanged rows are highlighted
|
||||||
#>
|
#>
|
||||||
[cmdletbinding(DefaultParameterSetName)]
|
[cmdletbinding(DefaultParameterSetName)]
|
||||||
Param(
|
Param(
|
||||||
#First file to compare
|
#First file to compare
|
||||||
[parameter(Mandatory=$true,Position=0)]
|
[parameter(Mandatory=$true,Position=0)]
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user