7
1
Having a powershell opened, it's possible to give it administrator priviledges ?
It's embedded in an IDE (Visual Studio Code) and I don't want to open a new terminal everytime I do something that needs administrator priviledges (like npm install ... --save-dev)
If not, can I set VS Code to open terminals with administrator priviledges ?
2Try opening VS Code as administrator, this may provide admin privileges to the terminal as well, I guess. – Ĭsααc tիε βöss – 2017-10-03T12:09:15.163
No; In order for a process to have escalated permissions it must be started with escalated permissions. This is the reason whenever an application requests elevated permissions the process is relaunched. – Ramhound – 2017-10-03T14:03:04.003
Have you looked in VSC's User Settings? The path to PS is there, along with other PS parameters. Not sure if VSC launched with standard privileges could start a child process as admin, though. – root – 2017-10-03T14:41:19.423
@Ĭsααctիεβöss VSC is started with standard priviledges. If I start it with Admin priviledges, powershell will have admin too. Thank you – Alex Huiculescu – 2017-10-04T10:16:13.487
@root VCS has a bunch of settings for terminal, but not the one to start the powershell as admin. – Alex Huiculescu – 2017-10-04T10:16:18.283
@Ramhound can you give me some more details ? I just started Operating Systems course and I'd like to learn from the docs – Alex Huiculescu – 2017-10-04T10:16:20.617
@Ĭsααctիεβöss You should post this as an answer and the requester should accept this as an answer. – root – 2017-10-19T15:07:08.790
This used to be able to be resolved as mentioned in this writeup, however I wasn't able to replicate using PowerShell 6 (with ConEmu, VS Code, or the new Terminal), however you should be able to do research on google to figure out what needs to be modified in the writeup's
– JW0914 – 2019-08-19T16:20:57.197Restart-Host
function. However, what should never be done is running VS Code with Admin privileges, as it allows arbitrary code from within VS Code to execute with admin privileges on the host << Massive Security Risk