title: Powershell Start-Process -NoNewWindow not working with -Credentials
body: <p>I am looking to run an exe from powershell using a credential. I want the output to be in the same window. This is how my powershell looks. </p>
  
  <p><code>Start-Process</code> documentation: <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-6" rel="noreferrer">https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-6</a></p>
  
  <pre><code>$username = 'user'
  $password = 'password'
  $credentials = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
  $pathNew = "c:\pathtomyexe\text.exe" 
  Start-Process $pathNew -NoNewWindow -Credential ($credentials) -PassThru -Wait
  </code></pre>
  
  <p>With <code>-Credential ($credentials)</code> a new window is launched.</p>
  
  <p>When I run <code>Start-Process</code> without <code>-Credential</code>, I get result in the same window as expected. </p>
  
  <pre><code>Start-Process $pathNew -NoNewWindow -PassThru -Wait
  </code></pre>
  
  <p>What am I doing wrong? Any pointers? </p>