vCheck-vSphere icon indicating copy to clipboard operation
vCheck-vSphere copied to clipboard

Potential Update: Filtered and Organized Table of Contents

Open klaus385 opened this issue 8 years ago • 2 comments

Firstly thank all contributing parties for the hard work done on this script truly makes my job better!

I ended attempting so below but its very crude and needs to be more dynamic. At least to try and adhere to good development practices.

Such as changing the Style.ps1 and the "TOC" function to parse the $pr.PluginID's and $pr.Title in such a way that it filters into categories.

For Example ->

 +--+--+--+--+--+
 |     |     |    |     |     |
 +--+--+--+--+--+
 |     |     |    |     |     |
 +--+--+--+--+--+

Where each column is a category and the rows are the plugin list.

Currently i had to configure categories manually by writing HTML out and using the TOCHTML to represent the HTML code needed. As well as with the Plugin's and Titles by adding them to an array and using this array data to pipe to TOCHTML. If anyone has an idea to make this more dynamic i'd appreciate any advice you have to give.

Example of current code ->

http://pastebin.com/gCrbJWKh

The hope would be to integrate on configuration a styling preferences.

klaus385 avatar Oct 25 '16 19:10 klaus385

I like this idea, the table of contents can get pretty out of control in lager reports so making it a bit easier to read is welcomed.

We already have a $PluginCategory defined in each plugin, though at the moment they are all set to vSphere. We could update those to be an actual category, or at least a new standard of vSphere-Datastore or something similar if we want to be able to mix plugins from multiple environments (i.e. vSphere, Exhange, AD).

We can extend the $PluginResult array to include the category, which would need a change to Get-PluginID to return the Category as well. Then the Get-ReportTOC function can just use grouping to make this much simpler.

Sneddo avatar Oct 25 '16 22:10 Sneddo

I didn't look into utilizing it this way. Ill be sure to try and see if this is possible my implementation above now seems more crude. Thanks for the suggestion if i come up with something i feel is up to good coding practice ill update this thread.

klaus385 avatar Oct 26 '16 18:10 klaus385