I am writing a project where I run a PowerShell script and create a new PSSession as follows:
PowerShell.exe -Command enter-pssession myUser -credential userName
When I run this, it opens a dialog box prompting the user to enter a password. However, I would prefer that the user can enter the password along with the rest of the above line, instead of worrying about the invitation. I am very new to PowerShell, and everything I found in the docs provides only ways to enter password hints. Is this something that can be done in PowerShell? Thank!
source
share