If you find a better question that encompasses my situation, please let me know. I haven't found my case yet.
I tried running an elevated powershell command with:
powershell -command "somecommand -Verb runas"
as
powershell -command "robocopy \\hostess\blab\foo 'C:\Program Files\foo ' /s /e /r:0 /z -Verb runas"
The robocopy part works by itself but then adding powershell causes:
ERROR : Invalid Parameter #7 : "-Verb"
The verb is a parameter of powershell executable and not part of the command parameter
powershell -command "robocopy \\hostess\blab\foo 'C:\Program Files\foo ' /s /e /r:0 /z" -Verb runas
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.