Why can’t I use PowerShell’s Start-Process with both -Credential and -Verb parameters?

Question:

Using powershell.exe, I want to emulate cmd.exe‘s runas command with the additional benefit of escalating privileges through UAC.

However, if I both supply both -Credential and -Verb Runas parameters to Start-Process, I get the error below:

Using only one of these parameters yields no errors:

Why is that? Both syntax forms of Start-Process accept [<CommonParameters>], which -Verb Runas belongs to?

Answer:

The -Verb parameter is only available in one of the parameter sets (if you do Get-Help Start-Process you can see it explictly listed in the second set):

It’s not a part of CommonParameters, that just includes things like -Debug, -Verbose, -ErrorAction etc. (see the full list here).

This seems to be a possible workaround:

Source:

Why can’t I use PowerShell’s Start-Process with both -Credential and -Verb parameters? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply