Introduction
Both source and target PowerShell systems support the Custom connector configuration option. This lets you store input parameters needed in your PowerShell scripts, such as API keys and secrets, passwords, URLs, etc. It accomplishes this by letting you define a UI form in which you can enter the parameter values. You then receive them inside a $configuration
JSON string in your PowerShell scripts.
This feature lets you change your input parameters more easily than when they are hard-coded into your scripts. Additionally, moving parameters out of your scripts lets you more freely share them without leaking sensitive information.
This feature is powered by Formly.
This article shows you how to use this option for source PowerShell systems as well as target PowerShell systems. The process is nearly identical for both.
Custom connector configuration
To get started, go to the System tab (for source PowerShell systems):
Or, the Account tab (for target PowerShell systems):
Select the wrench icon for Custom connector configuration to open the form JSON editor:
By default, the JSON editor contains boilerplate examples for each type of supported form element (required text, multi-line text, password, email, toggle, radio button, and drop down menu). Customize these as needed for your PowerShell scripts. Note that a dot (.
) in a key value makes it a sub-object. This is useful if you're working with credentials from multiple systems at the same time.
You can preview the resulting JSON string in the Result area. Each value is identified by its key
.
After you've defined a form in JSON, the source or target system's Configuration tab becomes available, containing your new form:
Here, enter the actual values that you wish to pass into your PowerShell scripts, and select the Save button.
To then use these parameters, go to the System tab (for source PowerShell systems) where your Persons and Departments PowerShell scripts or located. Or, go to the Account tab (for target PowerShell systems), where your user account lifecycle PowerShell scripts are located.
In these scripts, you now have access to the $configuration
JSON string. Convert it to a PowerShell object with $config = ConvertFrom-Json $configuration
, and then access $config
's properties via their respective key
values as defined in the form's JSON.