One minute
escalate UAC in Powershell with sudo
For a while now, I have been working professionally with Intune software deployment. I often have to test various scripts for customers. These often require admin rights. Since I’m tired of starting the Powershell as admin every time, I started looking for a way around the problem. I found something on Github.
https://github.com/gerardog/gsudo
(G)sudo
…is probably known from the Linux universe and that’s exactly how it works. Just type sudo or gsudo in front of the command that needs extended privileges and an admin prompt appears without having to open a new shell.
The whole thing can be installed with Powershell (as admin ;-))
PowerShell -Command "Set-ExecutionPolicy RemoteSigned -scope Process; iwr -useb https://raw.githubusercontent.com/gerardog/gsudo/master/installgsudo.ps1 | iex"