title: how to pass parameter to a powershell script when running from a shell script through cygwin?
body: <p>i have sh script let say a.sh in which i am doing a ssh to windows server (configured with cygwin) and running a <code>B.ps1</code> script which takes the parameter defined in <code>a.sh</code>.</p>
  <p>Content of <code>a.sh</code>:</p>
  <pre><code>var1=&quot;abc&quot;
  var2=&quot;xyz&quot;
  
  #sshing to windows box
  /usr/bin/scp -r -q /home/$user/Jenkins/workspace/job/jobname $user2@$x:/cygdrive/C/
  /usr/bin/ssh $user2@$x 'powershell C:\\B.ps1 $var1 $var2'
  </code></pre>
  <p>this is running the script but without any parameters, when i write host variable name in B.ps1, i get blank output, which means the var1&amp;var2 values are not getting passed to my ps1 script.</p>
  <p>Content of <code>B.ps1</code>:</p>
  <pre><code>$var1=$args[0]
  $var2=$args[1]
  
  Write-Host &quot;var1 is:&quot; $var1
  Write-Host &quot;var2 is:&quot; $var2
  </code></pre>
  <p>i have tried to use double quotation in my sh script , didn't work, it seems like there must be some way i can pass parameter but may be missing out anything on syntax.</p>
  <p>please help.</p>