使用 gsudo
github链接: https://github.com/gerardog/gsudo
官方给的安装方法:
If you use any of the following Package Managers:
Using WinGet: Run winget install gerardog.gsudo
Using Chocolatey: Run choco install gsudo
Using Scoop: Run scoop install gsudo
Or:
Download and run the MSI file from the latest release.
Or use the following script to achieve the same:
PowerShell -Command "Set-ExecutionPolicy RemoteSigned -scope Process; [Net.ServicePointManager]::SecurityProtocol = 'Tls12'; iwr -useb https://raw.githubusercontent.com/gerardog/gsudo/master/installgsudo.ps1 | iex"Manually: Download the ZIP file from the latest release. Uncompress and add to PATH.
使用 Sudo for Windows
微软官方文档: https://learn.microsoft.com/zh-cn/windows/sudo/
评论区