Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

tI am trying to run a powershell script from another powershell script using alternate credentials.

If I run:

$cred = get-credentials
$localArgs = "/c Powershell c:\myscript.ps1"

Start-Process cmd.exe -ArgumentList $localArgs -Credential $cred -WindowStyle="Hidden"

the script errors with:

Start-Process : Parameter set cannot be resolved using the specified named parameters.

If I remove:

-Credential $cred

The script runs fine (but with the wrong credentials.)

Am I missing something in terms of how to use the -Credential agument?



share|improve this question
up vote 1 down vote accepted

If you are using the -Credential argument, you may need to also specify the -FilePath argument:

$cred = Get-Credential
start-process -FilePath C:\WINDOWS\system32\cmd.exe -Credential $cred
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.