Answers for "runas powershell"

C
0

how to login to another user in powershell

$username = 'user'
$password = 'password'

$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
Start-Process Notepad.exe -Credential $credential
Posted by: Guest on May-12-2020
5

powershell script run

./myscript.ps1  //if is in the current directory
c:/scripts/myscript.ps1  //if you want to use the full path
&"C:/my path with space/myscript.ps1"  //if your path has spaces
Posted by: Guest on February-05-2020

Code answers related to "C"

Browse Popular Code Answers by Language