SRXEnv

1.0.3

Provides the ScriptRunner PowerShell Host Environment Variable $SRXEnv for test and development purposes.

The SRXEnv hashtable provides the following keys:

[string]ReportEmail:
If you have an SMTP server available, the ScriptRunner service can send you email notifications containing execution reports, on error or on success.
Recipient email address (comma sepa
Provides the ScriptRunner PowerShell Host Environment Variable $SRXEnv for test and development purposes.

The SRXEnv hashtable provides the following keys:

[string]ReportEmail:
If you have an SMTP server available, the ScriptRunner service can send you email notifications containing execution reports, on error or on success.
Recipient email address (comma separated list). The full action report will be sent to this address.

[string]ResultEmail:
Recipient email addresses (comma separated list). Only the ResultMessage will be sent to this address.

[string]ResultHtml:
The ScriptRunner PowerShell host supports HTML results through the $SRXEnv.ResultHtml variable. The HTML web page can then be easily
retrieved from the ScriptRunner Apps and WebApps. For example, you can use the ConvertTo-Html cmdlet to assign HTML to the ResultHTML variable.
There are new sample scripts in the Expl/Common folder of the ScriptRunner ScriptRepository that show how to create the HTML in your scripts.

[ArrayList]ResultList:
A scripted query must specify this list of string values. The list is associated with the corresponding action parameter.

[ArrayList]ResultList2:
A scripted query can specify this optional list of display names. The list appears as drop-down list for the associated action parameter.

[string]ResultMessage:
This message will show in the reports, and in the immediate result window of the Delegate and Self-Service App.

[string]ResultObjectJSON:
The script can now provide (simple) structured result data by writing a (small) JSON string to $SRXEnv.ResultObjectJSON.
ScriptRunner will provide this JSON string in the OutSerializedPSObjects report field, for post-processing by the caller of the Web Service Connector.

[string]SRXDisplayName:
The name of the current action. (readonly)

[DateTime]SRXStarted:
The timestamp of the start of the script execution. (readonly)

[string]SRXStartedBy:
The user account that requested the execution of the script. (readonly)

[string]SRXStartedIP:
IP address of the client that sent the request to perform the script execution. (readonly)

[string]SRXStartedVia:
The name of the application that started the execution of the script. (readonly)


The Cmdlet Reset-SRXEnvironment is used to reset the SRXEnv variable. (This Cmdlet is not available in the ScriptRunner PowerShell Host.)

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name SRXEnv -RequiredVersion 1.0.3

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Author(s)

ScriptRunner

Copyright

(c) 2020 ScriptRunner Software GmbH. All rights reserved.

Owners

Tags

ScriptRunner Windows Linux MacOS

Functions

Reset-SRXEnvironment

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

https://github.com/scriptrunner/ExtensionPack/tree/master/Modules/SRXEnv/readme.md

Version History

Version Downloads Last updated
1.0.4 103 3/18/2021
1.0.3 (current version) 139 2/11/2020
1.0.2 107 8/14/2019
1.0.1 42 7/18/2019