the cmdlet docs show Row Styling|You can style rows by using the -OnRowStyle parameter. The script block will be passed the row data as a hashtable in the $EventData variable. The script block should return a hashtable of CSS styles to apply to the row.
. So you are in the ballpark for sure. I’ve not done it, but there is an older forum post about it that might help:
https://forums.ironmansoftware.com/t/coloring-elements-in-a-table-based-on-a-property/57