• English speaking
  • Is there any way to get the output of a command executed using SuRun?

Hello,

If in a PowerShell window I run:
powershell.exe -NonInteractive -NoLogo -NoProfile -Command "Write-Output Test"
the output is:
Test

However if in the same window I run:
surun /wait powershell.exe -NonInteractive -NoLogo -NoProfile -Command "Write-Output Test"
nothing is displayed.

Is there any way to make the output be displayed in the same PowerShell console from which SuRun was launched?

Regards,
Claudio

That's not (easily) possible as powershell.exe runs inside a conhost container and processes inside that container cannot be launched with different logon tokens.
I tried about 12 years ago to find a way to reuse a cmd window and run a privileged process inside it, but it did not work because I could not connect the new process to the old cmd window, so i gave up on that.

Eine Antwort schreiben…
Impressum, Datenschutz