mkellerman / Invoke-CommandAs

Invoke Command As System/Interactive/GMSA/User on Local/Remote machine & returns PSObjects.
https://www.powershellgallery.com/packages/Invoke-CommandAs/
MIT License
455 stars 71 forks source link

Invoke-CommandAs -AsSystem broke on 2012 R2 ENG #53

Open PierreGUILBAUD opened 3 years ago

PierreGUILBAUD commented 3 years ago

Hello,

I have a issue on 2012 R2 ENG :

PS C:\Users\Administrator> Invoke-CommandAs -ScriptBlock { Get-Process } -AsSystem New-ScheduledTaskAction : Invalid class At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\private\Invoke-ScheduledTask.ps1:89 char:49

New-ScheduledTaskPrincipal : Invalid class At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\private\Invoke-ScheduledTask.ps1:91 char:56

Invoke-ScheduledTask : Cannot validate argument on parameter 'Principal'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\public\Invoke-CommandAs.ps1:399 char:17

The version of powershell is 5.1

Thank for your help.