title: Error passing a pillar variable with special characters to Salt's cmd.script
body: <p>I'm doing some automation with Salt using cmd.script with Powershell as the shell. While passing arguments to the state module, I get the error <strong>&quot; Cannot process argument transformation on parameter 'Conn_String'. Cannot convert value to type System.String.&quot;</strong>
  I saw this error can be resolved in a regular powershell script by wrapping the variable passed as an argument in single quotes('') but I don't know how I can achieve the same behavior in a salt state file where the variable is set using jinja as seen below. If I enclose Conn_String in single quotes like this <code> &quot;-Conn_String&quot; + 'Conn_String'</code> in the args, i get Conn_String in the PowerShell when I Write-Host instead of the actual connection string. I appreciate any help in resolving this.</p>
  <p>Here is an example of my state and PowerShell script:</p>
  <pre><code># pillar info in state
  # content of Conn_String is &quot;Server=testServer,2022;database=exampleDatabase;Integrated Security=SSP&quot;
  
  {% set var1 = pillar['var1'] %}
  {% set var2 = pillar['var2'] %}
  {% set Conn_String = pillar['Conn_String'] %}
  {% set args = &quot; -var1 &quot; + var1 + &quot; -var2 &quot; + var2 + &quot; -Conn_String &quot; + Conn_String %}
  
  CallPowerShell:
    cmd.script: 
      - source: {{ salt:// + pillar['var1'] + &quot;/scripts/sendmail.ps1&quot; %}
      - shell: powershell
      -cwd: D:\
      - args: {{ args }} 
  
  
  
  # The PowerShell script(sendmail.ps1) that is called
  param(
       [Parameter(Mandatory)]
       [string]$var2
       
       [Parameter(Mandatory)]
       [string]$Conn_String
       )
       Write-Host &quot;$Conn_String&quot;
       ...
  
  
  
  </code></pre>