ZTree.com  | ZEN  | About...  

 Index   Back

[Help!] Running elevated Powershell from F9 ?   [Help!]

By: Ron Metzger       
Date: Oct 09,2019 at 23:13
In Response to: [Help!] Running elevated Powershell from F9 ? (Laurent Duchastel)

> > Try "%#ZTTOOLS%\elevate\elevate64" -c -w ...
> >
> > Hope this helps, let us know.
> >
> > Ron Metzger
>
>
> Solved the issue!
>
> It wasn't the -w parameter which did the trick, but added quotation
> marks to delimit the PS script
>
> "%#ZTTOOLS%\elevate\elevate64"
> -c powershell.exe "Get-AppxPackage *officehub* | Remove-AppxPackage"
> pause
>
> This leads to a question : what would be the best way to run with F9 a
> PS script that span many lines ?

Quotes! Great catch.

As far as F9 goes, the question is whether F9 interprets line by line or
does it work like cmd.exe by interpreting command blocks then executing blocks at at time.

ex.
(
cmd 1
cmd 2
cme 3
)

Probably not relevant just like my last suggestion.

Any way, good luck.

Ron Metzger

123 views      
 

Messages in this Thread

 
94,671 Postings in 11,938 Threads, 348 registered users, 12 users online (0 registered, 12 guests)
Index | Admin contact |   Forum Time: Dec 15, 2019 - 6:51 pm EST  |  Hits:29,414,663  (2,405 Today )
RSS Feed