Template PowerShell Script structure

  • 27 January 2020
  • 0 replies
  • 356 views
Template PowerShell Script structure
Userlevel 5
Badge +15

Report templates are built from PowerShell script and Microsoft Excel files, this article will dive deeper into the PowerShell scripts.

An understanding of PowerShell is required to edit these files, there many online resources available to assist in learning more about PowerShell. This article is intended to point you in the right direction regarding updating the PowerShell scripts.

 

Script location

PowerShell scripts are stored in location:

  • C:\Users\[user]\AppData\Local\Webroot Reporting\Templates\[template name]\Scripts

Where:

  • [user] is the user account that installed Universal Reporter
  • [template name] is the name of the template

 

Script functionality

The PowerShell scripts for Universal Reporter share common ‘Export’ functions that call ‘Add’ functions for each of the spreadsheet reference sheets. The scripts use 2 Cmdlets Webroot created specifically for Universal Reporter, the Excel Cmdlet and the Unity API Cmdlet. It also uses a CommonFunctions module.

 

Here is an example of a script file, showing the high level structure:

​​​​​

Some template script files pre-process data before writing to the spreadsheet, these will have additional functions to ‘Group’ and ‘Convert’ data.

 

For additional information on Universal Reporter, please see:

 


This topic has been closed for comments