How to do conditional formatting in this example
Hey Doug, Great module by the way. I'm trying to do conditional formatting for cells that do not match a couple of values. Something like: if ($value -notmatch 'aaa' -and $value -notmatch 'bbb') { use this format... }
I tried: Remove-Item -Path $OutputFile -ErrorAction SilentlyContinue $FinalResult | Export-Excel -Path $OutputFile -Show -ConditionalText $( New-ConditionalText -ConditionalType NotContainsText $NTPServers[0].IPv4Address DarkRed LightPink New-ConditionalText $NTPServers[0].IPv4Address Blue Cyan New-ConditionalText $NTPServers[1].IPv4Address Blue Cyan ) -AutoSize -FreezeTopRowFirstColumn
where $NTPServers[0].IPv4Address and $NTPServers[1].IPv4Address are the 2 values that I'm referring to, but this makes everything other than $NTPServers[0].IPv4Address red/pink..
any advise?
Also, can you post an example of using -Range with New-ConditionalText?