Repository navigation
Usage
Mark Domansky edited this page Apr 12, 2026
·
6 revisions
- WebJEA's is controlled by a json configuration file, by default located at c:\scripts\config.json.
- Modifying WebJEA's configuration file is done by editing the json file directly.
- The top-level settings:
- Page Title
- Log Parameters (by default, can be overridden per command)
- Default Access groups (groups that will have access to all commands)
- Commands - Each command contains a name and set of optional features.
- Synopsis - recommended only for landing pages, is a pure html section of text and works well to direct the user to where they need to go. If specified, it will override what is found in the script.
- Script - this is the script the form will be generated from. It does not support Parameter Sets but does support most advanced function features
- Onload Script - this script will run when the page for the command is loaded
- Log Parameters - override whether this script logs parameters.
- Permitted Groups - a list of local or domain, users or groups that should have access to this command. The format is domain\user.
Body
@{
cmdid = 'apitest'
parameters = @{
Identity = 'ABC'
}
}
$cred = get-credential
Invoke-WebRequest -method POST -contenttype 'application/json' -url 'https://fqdn/api/execute' -credential $cred- The onloadscript supports parameter inputs. See below for how to use querystring inputs.
- Querystring parameters
- You can deeplink directly to a specific script using
https://site/?cmdid=<cmdid from config.json>. - You can also specify parameters be defining them in the querystring
.../?cmdid=abc¶m1=value. When received these will be used two ways. 1. as parameter inputs to the onloadscript. 2. as the default values in the form fields. - You can also send these via traditional form post.
- You can deeplink directly to a specific script using
- Variable Types
- String, Number, Boolean, DateTime, Arrays (String/Number/Boolean/DateTime)
- For multi-line input
[Parameter()] [string]$StrInput1, [Parameter()] #WEBJEA-Multiline [string]$StrInput2,
- Array inputs
[Parameter()] [string[]]$StrArrInput
- To take a date only parameter input (default)
[Parameter()] [datetime]$DTInput
- To take a parameter with date and time input
[Parameter()] #WEBJEA-DateTime [datetime]$DTInput
- Specify a HelpMessage value and it will override the parameter name on the form
[Parameter(HelpMessage="Alternate Prompt")] $StrInput1, [Parameter()] $StrInput2
- Default values
- Default Values
- Supported Validation for parameters
- Required fields
[Parameter(Mandatory)]
- ValidateSet, ValidateRange, ValidateCount, ValidatePattern
- Required fields
- To obtain the authenticated user's username use
$env:WebJEAUsername.
Deprecation Note: Older versions of WebJEA supported a hidden parameter of $WebJEAUsername. Please migrate to using the environment variable. - To obtain the authenticated user's hostname use
$env:WebJEAHostname.
Deprecation Note: Older versions of WebJEA supported a hidden parameter of $WebJEAHostname. Please migrate to using the environment variable. WebJEAHostname typically returns an IP Address. It is named Hostname because that's what IIS says it is. - These features are NOT SUPPORTED at this time.
- Dynamic Parameters
- ParameterSets - on the roadmap
- ValidateScript
- ShouldProcess - considering
- SecureString and Credential Inputs - on the roadmap
Note
WebJEA currently uses a hand-written script parser, so it can be easily broken. I plan to migrate to using PowerShell as the script parser, but that will take some time. Keep your parameter definitions simple.
Generated from docs/ on the master branch of the WebJEA repository. Do not edit the wiki directly - changes here are overwritten.