title: Passing parameters to powershell script from batch file
body: <p>I am calling a powershell script from a batch file, both in different locations.</p>
  
  <p>I would like to pass the folder location for the powershell script file as well as the parameter, a user entered string in the batch file, from that batch file.</p>
  
  <p>powershell script:</p>
  
  <pre><code>$url = "https://www.ons.gov.uk/generator?format=csv&amp;uri=/economy/inflationandpriceindices/timeseries/chaw/mm23"
  $output="sample.csv"
  $start_time = Get-Date
  $arg1=$args[0]
  Invoke-WebRequest -Uri $url -OutFile $arg1\$output
  Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
  </code></pre>
  
  <p>My Batch file :</p>
  
  <pre><code>powershell.exe -ExecutionPolicy Bypass -file C:\temp\download-rpi.ps1 "\\drives\savehere"
  </code></pre>