Skip to the main content.

ScriptRunner Blog

Improved and Enhanced PowerShell Reports

The execution of any PowerShell script with an action generates a report in ScriptRunner.

In existing versions, the report includes the Metadata blocks, the list of parameters with which the script was ultimately executed, and PowerShell output.

Post Featured Image

This article has been translated automatically.

The execution of any PowerShell script with an action generates a report in ScriptRunner. In existing versions, the report includes the Metadata blocks, the list of parameters with which the script was ultimately executed, and PowerShell output.

In version 2016 the reports will be further expanded. In addition to the blocks mentioned above, there is now also an error block in which the errors that occurred or led to an abort are summarized, as well as an output block.

The function and the use of the output block in the apps will be introduced in a later part. But this much in advance: the output block can be used to control result output both in the report and in the app.

For this, a global ScriptRunner variable $SRXEnv.ResultMessage is provided, which can be filled depending on the script logic.
Example

$SRXEnv.ResultMessage = “The user ” + $username + “was created successfully with ” + $mailaddress + “”

The global result variable can be assigned different result types like strings, tables, arrays etc., which will be converted to OutString for display in the report and in the UI.

The two illustrations show the report extensions with error and result blocks.

Report from PowerShell executions

PowerShell Reports: Comparison of Executions

In addition, the comparison function for comparing two reports has been reworked so that very different reports can now be compared exactly in the order in which they are output.

 

Related posts

14 min read

Graph PowerShell and Microsoft Teams – Part 3 of our series

Damian shares his knowledge about Microsoft Graph. His third article goes into detail about teams and introduces the...

15 min read

Exchange Online – Part 2 of our Graph PowerShell series

Explore the evolving landscape of managing Exchange Online with Microsoft's Graph PowerShell module versus the...

11 min read

Graph PowerShell SDK – Part 1 of our Graph series

Users will encounter one or two hurdles when they start using Graph. Damian Scoles wrote three articles provides help...

About the author: