PowerShell probe parameters

Several parameters can be passed to the PowerShell probe.

For information on configuring probe parameters, see Set probe parameters.

Parameter Name Description Default Value
source

[Required] The initial host to connect to.

none

<script name>.ps1

[Required] The filename of the PowerShell script to run. Replace <script name> with a valid filename prefix.
  • Name: Enter the file name of the PowerShell script. For example, my_powershell_script.ps1.
  • Value: Enter the PowerShell script. A good practice is to write the PowerShell scripts so that non-Boolean parameters do not appear on the command line.
none

powershell_command_parameter_passing

Specifies whether to pass script parameters on the command line. Regardless of this parameter's value, ServiceNow makes all script parameters on the command line automatically available to PowerShell scripts as environment variables.

  • A true value passes all script parameters on the command line. The upgrade process automatically sets this parameter to true if there are any user changes to the PSScript.ps1 script file.
  • A false value removes all non-Boolean script parameters from the command line. PowerShell scripts must instead access parameters using environment variables.
false
powershell_param_<script parameter name> Passes additional parameters to the PowerShell script to be executed. Each parameter will appear to the script as an environment variable in the format $env:SNC_<script parameter name>. Parameters with this prefix are not considered encrypted and are passed through to the script untouched. Make sure you select the appropriate parameter between powershell_param_<script parameter name> and powershell_<script parameter name>. Using the wrong prefix results in errors in the PowerShell execution, which is passed back to the instance in the ECC queue input.

powershell_<script parameter name>

Passes additional parameters to the PowerShell script to be executed. Each parameter will appear to the script as an environment variable in the format $env:SNC_<script parameter name>. The MID Server assumes that any parameter with this prefix is encrypted and attempts to decrypt it. Make sure you select the appropriate parameter between powershell_param_<script parameter name> and powershell_<script parameter name>. Using the wrong prefix results in errors in the PowerShell execution, which is passed back to the instance in the ECC queue input none
debug

Enables debug log output during the probe.

false