How do I open an IE window as a different user in Powershell?
<p>This works:</p>

<pre><code>Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe"
</code></pre>

<p>And this appears to work:</p>

<pre><code>$username = "domain\user"
$password = "password"
$cred = New-Object System.Management.Automation.PSCredential($username, $password)
</code></pre>

<p>But when I run this:</p>

<pre><code>Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe" -Credential $cred
</code></pre>

<p>I get this:
<a href="https://i.stack.imgur.com/DgLvS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DgLvS.png" alt="ISE Error"></a></p>

<p>I have also tried this, with the same outcome:</p>

<pre><code>$iePath = "C:\Program Files\Internet Explorer\iexplore.exe"
Start-Process -FilePath $iePath -Credential $cred
</code></pre>

<p>Why would I get a directory error when I am providing the full path to <code>iexplore.exe</code>?</p>