title: How to execute powershell script from jenkins by passing parameters
body: <p>I have a powershell script in my Github. i am trying to execute that via Jenkins. Here is a part of the script :-</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>param (
  +    [string]$fileDir = "%WORKSPACE%\src\Project\***",
   [string]$packagingDir = "%WORKSPACE%\src\packageTemp", 
   [string]$staticFilesToDeploy = "%WORKSPACE%\src\****"
    )</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now i am using a simple batch execution within Jenkins Job to run  this script. I am trying to run it as </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>powershell -noexit "&amp; ""%WORKSPACE%\src\***.ps1"""</code></pre>
  </div>
  </div>
  </p>
  
  <p>But when Jenkins actually executes this powershell script its unable to replace %workspace% within the script and fails as it cannot find that. How do i make jenkins to replace that within the script when it executes it actually</p>