This is a proof of concept more than a useful script.
Run the PowerShell script on a View Conneciton Server to gather data into CSV files.
Run the same PowerShell script on a machine with Word installed & it creates a report from the csv files in the same directory.
If your Connection Server has Word installed then both phases are run in one script execution.
To Do
- Make table generation more generic, create table from array of data
- Some error handling