I am an administrator and learning about scripts but was trying to create a script to open multiple programs as another user (my admin password)
The following script runs well when run from powershell ise but won't run properly when right clicking and selecting "run with powershell"
Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -Credential "domain\userid"
When run it prompts for password but doesn't bring up google chrome. It works OK when run from Powershell ISE and I get error "The directory name is invalid"
when running the script from Powershell.exe (not the ISE environment).