Skip to content

Set-PSHCellColor when Filter property matches in value #11

@SamWalkerRxSense

Description

@SamWalkerRxSense

Set-PSHCellColor doesn't add the background-color when the the property name is matched in the value. Better explained with an example.

$StartHTML = @"
Column1 , Column2 , Column3 , Column4 , Server
1       , 2       , 3       , 4       , ServerA
1       , 1       , 2       , 4       , ServerB
1       , 1       , 1       , 1       , ServerC
test    , one     , two     , three   , ServerA
4       , 4       , 4       , 4       , ServerB
4       , 3       , 2       , 1       , .[?]\
"@ | ConvertFrom-Csv | ConvertTo-Html
$StartHTML | Set-PSHCellColor -Color Red -Filter 'server -eq "serverA"'

It seems the issue is line 134, -replace is replacing all matches in $Filter,
$Filter = $Filter -replace $Property,"$Value"`

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions