The variable needs to double escaped inside the string, once for Powershell using the backtick(`), and once for the parser using a backslash(\). So the variable ends up looking like this – \`"$Search\`"
And the full command then look slike this –
$Search = "abc (def)"
im issues - -hostname=$host - -user=$User - -port=$Port - -queryDefinition="((field[FRED] contains \`"$Search\`") and (field[Type] = Group Definition))" - -fields="ID"
The topic ‘Formatting of command for external application’ is closed to new replies.