diff --git a/Merge-worksheet.ps1 b/Merge-worksheet.ps1 index cdf1d49..2c321cd 100644 --- a/Merge-worksheet.ps1 +++ b/Merge-worksheet.ps1 @@ -101,13 +101,13 @@ #Name of a column which is unique used to pair up rows from the refence and difference side, default is "Name". $Key = "Name" , #Sets the font color for the "key" field; this means you can filter by color to get only changed rows. - [System.Drawing.Color]$KeyFontColor = "DarkRed", + [System.Drawing.Color]$KeyFontColor = [System.Drawing.Color]::DarkRed , #Sets the background color for changed rows. - [System.Drawing.Color]$ChangeBackgroundColor = "Orange", + [System.Drawing.Color]$ChangeBackgroundColor = [System.Drawing.Color]::Orange, #Sets the background color for rows in the reference but deleted from the difference sheet. - [System.Drawing.Color]$DeleteBackgroundColor = "LightPink", + [System.Drawing.Color]$DeleteBackgroundColor = [System.Drawing.Color]::LightPink, #Sets the background color for rows not in the reference but added to the difference sheet. - [System.Drawing.Color]$AddBackgroundColor = "PaleGreen", + [System.Drawing.Color]$AddBackgroundColor = [System.Drawing.Color]::PaleGreen, #if Specified hides the rows in the spreadsheet that are equal and only shows changes, added or deleted rows. [switch]$HideEqual , #If specified outputs the data to the pipeline (you can add -whatif so it the command only outputs to the pipeline). @@ -229,9 +229,9 @@ foreach ($result in $_.Group) { if ($result.SideIndicator -ne "=>") {$hash["_Row"] = $result._Row } elseif (-not $hash["$DiffPrefix Row"]) {$hash["_Row"] = "" } - #if we have already set the side, this must be the second record, so set side to indicate "changed"; if we got two "Same" indicators we may have a classh of keys + #if we have already set the side, this must be the second record, so set side to indicate "changed"; if we got two "Same" indicators we may have a classh of keys if ($hash.Side) { - if ($hash.Side -eq $result.SideIndicator) {Write-Warning -Message "'$keyval' may be a duplicate."} + if ($hash.Side -eq $result.SideIndicator) {Write-Warning -Message "'$keyval' may be a duplicate."} $hash.Side = "<>" } else {$hash["Side"] = $result.SideIndicator} @@ -259,7 +259,7 @@ elseif ($result.SideIndicator -eq "=>") { $hash[("$DiffPrefix $p")] = $result.$P} } } - + foreach ($k in $hash.keys) {$eDiffProps[$k] = $true} [Pscustomobject]$hash } | Sort-Object -Property "_row" @@ -375,13 +375,13 @@ Function Merge-MultipleSheets { #Name of a column which is unique used to pair up rows from the refence and difference side, default is "Name". $Key = "Name" , #Sets the font color for the "key" field; this means you can filter by color to get only changed rows. - [System.Drawing.Color]$KeyFontColor = "Red", + [System.Drawing.Color]$KeyFontColor = [System.Drawing.Color]::Red, #Sets the background color for changed rows. - [System.Drawing.Color]$ChangeBackgroundColor = "Orange", + [System.Drawing.Color]$ChangeBackgroundColor = [System.Drawing.Color]::Orange, #Sets the background color for rows in the reference but deleted from the difference sheet. - [System.Drawing.Color]$DeleteBackgroundColor = "LightPink", + [System.Drawing.Color]$DeleteBackgroundColor = [System.Drawing.Color]::LightPink, #Sets the background color for rows not in the reference but added to the difference sheet. - [System.Drawing.Color]$AddBackgroundColor = "Orange", + [System.Drawing.Color]$AddBackgroundColor = [System.Drawing.Color]::Orange, #if Specified hides the columns in the spreadsheet that contain the row numbers [switch]$HideRowNumbers , #If specified outputs the data to the pipeline (you can add -whatif so it the command only outputs to the command) diff --git a/New-ConditionalText.ps1 b/New-ConditionalText.ps1 index edbbf06..45e966c 100644 --- a/New-ConditionalText.ps1 +++ b/New-ConditionalText.ps1 @@ -40,8 +40,8 @@ function New-ConditionalText { [Alias("ConditionValue")] $Text, [Alias("ForeGroundColor")] - [System.Drawing.Color]$ConditionalTextColor="DarkRed", - [System.Drawing.Color]$BackgroundColor="LightPink", + [System.Drawing.Color]$ConditionalTextColor=[System.Drawing.Color]::DarkRed, + [System.Drawing.Color]$BackgroundColor=[System.Drawing.Color]::LightPink, [String]$Range, [OfficeOpenXml.Style.ExcelFillStyle]$PatternType=[OfficeOpenXml.Style.ExcelFillStyle]::Solid, [ValidateSet(