SRXEnv

1.0.7

Provides the ScriptRunner PowerShell host environment variable $SRXEnv for test
and development purposes.

The SRXEnv hash table provides the following keys:

[string] ReportEmail: (3.10.4133.0)
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 ad
Provides the ScriptRunner PowerShell host environment variable $SRXEnv for test
and development purposes.

The SRXEnv hash table provides the following keys:

[string] ReportEmail: (3.10.4133.0)
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: (3.10.4133.0)
Recipient email addresses (comma-separated list). Only the result message will be sent to this address.

[string] ResultHtml: (5.2.6155.0)
The ScriptRunner PowerShell host supports HTML results through the $SRXEnv.ResultHtml variable.
The HTML web page can then be easily retrieved from the ScriptRunner Portal.
For example, you can use the ConvertTo-Html cmdlet to assign HTML to the ResultHTML variable.
You can find a sample script at https://github.com/scriptrunner/ActionPacks under Reporting > _LIB_ > ReportsLibrary.ps1

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

[ArrayList] ResultList2: (4.0.4511.0)
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: (3.00.3670.0)
The result message will be displayed in reports and in the immediate result window of the ScriptRunner Portal.

[string] ResultObjectJSON: (4.1.4738.0)
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] SRXActionID: (6.2.577.0)
The ID of the started action. (read-only)

[string] SRXApprover: (7.3)
The user account that approved the execution. (read-only)

[string] SRXCommandPath: (6.2.642.0)
Full file path of the executed script file used by the started action (similar
to the PowerShell $PSCommandPath auto variable). (read-only)

[string] SRXDisplayName: (4.1.4738.0)
The name of the current action. (read-only)

[string] SRXFilterValue: (6.2.577.0)
In case of query execution, this key contains the current filter value
from the search filter form in the UI. (read-only)

[string] SRXNodeName: (7.2)
The name of the ScriptRunner node on which the action is executed. (read-only)

[ArrayList] SRXRequiredModules: (6.2.642.0)
The list of PowerShell modules that are explicitly loaded by ScriptRunner. (read-only)

[string] SRXRunOn: (6.2.642.0)
The hostname of the target machine where the script is executed. (read-only)

[string] SRXScriptName: (6.2.642.0)
The script file's path relative to the root of the script source. (read-only)

[DateTime] SRXStarted: (4.1.4738.0)
The timestamp of the start of the script execution. (read-only)

[string] SRXStartedBy: (4.1.4738.0)
The user account that requested the execution of the script. (read-only)

[string] SRXStartedIP: (4.1.4738.0)
The IP address of the client that sent the request to execute the script. (read-only)

[string] SRXStartedReason: (4.1.4738.0)
A reason message entered by the user who started the action. (read-only)

[string] SRXStartedVia: (4.1.4738.0)
The name of the application that started the execution of the script. (read-only)

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

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

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name SRXEnv

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

Owners

Copyright

© 2015-2025 ScriptRunner Software GmbH. All rights reserved.

Package Details

Author(s)

  • ScriptRunner

Tags

ScriptRunner Windows Linux MacOS

Functions

Reset-SRXEnvironment

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

https://support.scriptrunner.com/articles/release/srxenv

FileList

Version History

Version Downloads Last updated
1.0.7 (current version) 33 a month ago
1.0.5 1,570 8/9/2022
1.0.4 270 3/18/2021
1.0.3 148 2/11/2020
1.0.2 116 8/14/2019
1.0.1 52 7/18/2019
Show more