title: How can I run PowerShell as an administrator AND with arguments from a batch file?
body: <p><strong>I've found answers for both tasks separately, but not together:</strong></p>
  
  <ul>
  <li><p>Run PowerShell <em>as an administrator</em> from a batch file</p></li>
  <li><p>Run PowerShell  <em>with arguments</em> from a batch file</p></li>
  </ul>
  
  <p>But I want to run PowerShell <em>as an administrator</em> <strong>AND</strong> <em>with arguments</em> from a batch file.</p>
  
  <p><em>For this reason, I'm convinced this isn't a duplicate so far.</em></p>
  
  <p><strong>This problem is complicated for this reason:</strong></p>
  
  <p>I'm using the <code>ArgumentList</code> switch to point to the file path when running an elevated PowerShell. I'm also using it to pass in arguments. Separately, I have been able to use this switch with success. It doesn't seem as though I can use it for both tasks though.</p>
  
  <p><strong>Here's how I'm using PowerShell currently:</strong></p>
  
  <p>As an administrator:</p>
  
  <pre><code>powershell -Command "&amp; {Start-Process powershell -ArgumentList '-File "filePath.ps1' -Verb RunAs}"
  </code></pre>
  
  <p>With arguments:</p>
  
  <pre><code>powershell -ExecutionPolicy unrestricted Import-Module "filePath.ps1" -ArgumentList "arg1","arg2"
  </code></pre>
  
  <p><strong>What I've tried:</strong></p>
  
  <p>I've tried just adding my arguments to the <code>ArgumentList</code> where the file is passed in, but they weren't recognized.</p>
  
  <p>I also tried adding <code>-Verb RunAs</code> to the working argument line, but PowerShell thought that I was trying to pass in another argument called Verb, and failed to run PowerShell as and admin.</p>
  
  <p>Is it possible to accomplish both running PowerShell as an administrator, and with arguments, by switching up how I'm passing in arguments, or how I'm elevating the PowerShell?</p>