Applications Systems

Maintain equals sign (=) in PowerShell script arguments (SAM)

Use the workaround provided in this article to resolve PowerShell issues that occur when only the first half of a script argument is recognized when an equals sign (=) is included.

First published date

11/9/2018 4:22 PM

Last published date

11/9/2018 4:22 PM

Overview

This article describes how to resolve an issue that occurs when adding an equals sign (=) to a PowerShell monitoring script. When you click the Get Script Output button and run the script, the equals sign disappears along with any code after it. Only the first part of the provided argument is displayed as an output, with an additional '-' sign at the beginning.

An "equals sign" is also known as an "equality sign".

Product section

Server Application Monitor

Cause

SAM only recognizes the first part of the script that appears before the equals sign, as shown in this example:

 

This issue will be fixed in a future SAM release. See below for an interim workaround. 

Resolution

Add a prefix so the script recognizes the two separate arguments; the first argument contains a new prefix and the second has the actual argument including the equality sign, as shown here: 

value=abc=def

Additional changes to the script may be required, as shown in this example:

 

 

See also: