ReportCardPS icon indicating copy to clipboard operation
ReportCardPS copied to clipboard

A couple of questions surrounding card tables

Open CRad14 opened this issue 6 years ago • 1 comments

Is there a way to add highlighting logic around tables? For instance on the default Alarms card, if an object has 4+ alarms highlight it red/orange/whatever. I am creating some of my own functions and this would be helpful to know how to add.

Secondly, is there a way to easily change the format of tables in cards? If I want to right-align, or add internal grid borders for example.

Thanks!

CRad14 avatar Nov 21 '19 19:11 CRad14

Great question! Would you want the entire card color to change? or just the line item in the table?

changing the background of a whole card is much easier than rows in a table.

Sky is the limit, but it would require you to customize the HTML. Which could prove to be challenging.

This code is from the built-in alarm function

$vCenterTop5Alarms = $vCenterAlarmCollection | Sort-Object -Property WarningsCount -Descending | Select-Object -First 5 | ConvertTo-Html -Fragment

With PowerShell, in order to change any of the formatting of the HTML output , or the formatting of the table, you would need to edit the HTML that is returned to $vCenterTop5Alarms. That is really just a text blob.

there are a few PowerShell HTML editors, but I've not seen anything that really can take the HTML elements and convert them to PowerShell objects. Which is why I created (https://github.com/jpsider/ClarityPS) But even that does not allow you to change the output of the 'ConvertTo-Html' cmdlet.

jpsider avatar Nov 21 '19 20:11 jpsider