I'm trying to write a PowerShell script to check if the process is running and if the process is not running, start OneDrive.exe. I tried:
$newProc = new-object System.Diagnostics.ProcessStartInfo "OneDrive"
$newProc.Arguments = 'explorer.exe $pathToOneDrive'[System.Diagnostics.Process]::Start($newProc)
The problem is OneDrive error
OneDrive can't be run using full administrator rights
I tried the -runas which did not work.
How can I solve this problem?