D
D
Digsecman2021-07-30 11:26:27
PowerShell
Digsecman, 2021-07-30 11:26:27

How to open a new console window with admin rights at the end of a powershell script?

Hello!
Can you please tell me how to execute a powershell script that, when it finishes, will close the current window, but before that it will call the next terminal window and execute the following piece of code there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor L, 2021-07-30
@Fzero0

$argList = "-file `"$Location\script.ps1`""
Start-Process powershell -Verb runAs -ArgumentList $argList

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question