Stephanevg / PSHTML

Cross platform Powershell module to generate HTML markup language
https://pshtml.readthedocs.io/en/latest/
Other
168 stars 43 forks source link

Bug in Convertto-PSHTMLTable #210

Closed LxLeChat closed 5 years ago

LxLeChat commented 5 years ago

Subject of the issue

Piping ojects into Convertto-PSHTMLTable doesnt work as excpected.

Steps to reproduce

get-service | select name | Convertto-PSHTMLTable

Expected behaviour

The html tale code should contain all services returned by the get-service cmdlet.

Actual behaviour

Only the last entry from get-service is present in the html table

LxLeChat commented 5 years ago

We can do as follow: declare a hahstable in the begin block with 3 values : thead, tbody and tfoot. in the process block, for the first iteration (coming from the pipeline or not) we get the object properties and fill the hashtable.thead for the next iterations, if the hashtable.thead is not null, we work with the hahstable.tbody

and in the end block, we do some stuff and voila !

LxLeChat commented 5 years ago

same issue as #202

Stephanevg commented 5 years ago

fixed https://github.com/Stephanevg/PSHTML/pull/214