1

I'm trying to run a PowerShell script that requires admin rights and the user I'm logged in as doesn't have admin rights. I have no problem temporarily storing the admin credentials on in the script or somewhere else on the computer. I know this is a security issue but Im testing a solution. Below is the code but it errors out with a weird error that doesn't make any sense to me.

Start-Process powershell -Credential (Get-Credential) -ArgumentList "-file C:\test.ps1"

druffin
  • 163
  • 2
  • 15

0 Answers0