I want to open a console using credentials of someone else.
Normally I do it with the runas
command:
C:\> runas /user:$(cat ~\.ssh\ek | select -first 1) pwsh
Enter the password for ***:
Attempting to start pwsh as user *** ...
C:\>
Having entered the password, I can see the console opened and it works great.
However, I do not like that I have to type the password every time.
The Powershell's Start-Process
should help, because I can pass it a credentials object.
For example:
C:\> $creds = Import-Clixml -Path ~/.ssh/ek.creds
C:\> Start-Process pwsh -Credential $creds -WorkingDirectory ***
C:\>
At the end a console is open, but I am unable to use the keyboard - nothing happens when typing or pasting.
What am I missing?