Using PowerShell on command line to start a server with admin privileges

1

I have an agent.exe, when run with Windows PowerShell, starts a server on port 18383:

> powershell -Command ".\agent.exe"
⇨ http server started on [::]:18383

Above command, pops up a security dialog like this:

PowerShell runs executable


Following this post and its comments, I try to run agent.exe with PowerShell with admin privileges, but I cannot figure out how to compose my command. Can anybody help?

user3405291

Posted 2019-12-23T08:26:10.427

Reputation: 199

Answers

1

Problem is fixed by using this command to run as admin:

> powershell -Command "Start-Process '.\agent.exe' -Verb runAs"

Run with admin privileges

user3405291

Posted 2019-12-23T08:26:10.427

Reputation: 199