Closed WayneSherman closed 5 years ago
Seems the issue is when you're not using the Invoke-CommandAs on a remote machine (ie: you're running it locally).
Correct. For my use case I need a simple way to execute PowerShell commands and scripts as "NT AUTHORITY\SYSTEM" on the local computer.
You can use the Invoke-ScheduledTask function in the private folder to run it locally. That’s what I’ll be doing in the next version. If no ComputerName/Session provided, run it directly as a ScheduleTask.
Thanks, Invoke-ScheduledTask is working.
3.1.4 has been publish to the gallery. This should work now with Invoke-CommandAs locally.
Using file \Scripts\Invoke-CommandAs.ps1 downloaded from github. Testing on Windows 10 IoT Enterprise LTSC 2019 (ver 1809)
test.ps1 has 2 lines:
When running I get several error messages, the first one is: