Closed Zweikeks closed 5 years ago
It requires Default.cmd to be already started as admin
This is unfortunately a pretty big limitation, so I've implemented logging as optional command line -log
parameter. Windows generally can't redirect output of privileged process to unprivileged one (at least not with /runas
), so it doesn't achieve the exact same as your PR, but if the ultimate goal is to have a transcript of the script output, then it gets the job done.
Alternative way to call the script. Stdout and stderr is redirected with Tee-object. Added as a comment/hint for people who wants to use it that way.
It requires Default.cmd to be already started as admin. RequireAdmin does not work. Tested with Win7 64bit, PowerShell 2.0 and Win10 1809 64bit, PowerShell 5.1. Handles spaces in pathes and file names.