title: Powershell script to change users and launch another script
body: <p>I have a script called ADInfo.ps1 that is used to query AD using the ActiveDirectory module in Powershell.  In order to run the script, you must be running Powershell as an AD user.  This is not an issue with most of our customers as we log into most of our customer's servers with AD accounts - but not always.  I know that we can run this to open a new PS window with AD credentials:</p>
  
  <pre><code>Start-Process powershell.exe -Credential ""
  </code></pre>
  
  <p>I'm trying to take the thought out of this for my team, so I'm trying to find a way to run the script, and if it finds it's not running PS as a domain account that it will prompt for AD credentials and re-run the script.  So is there a variation of the line above where I could force it to launch</p>
  
  <pre><code>.\ADInfo.ps1
  </code></pre>
  
  <p>as an Active Directory user?</p>