找到解决办法了.
下载 gsudo
https://github.com/gerardog/gsudo/releases把 gsudo.exe 解压到 system32 目录,
Windows Terminal 的配置文件如下:
就每次启动都是管理员权限了,然后新建标签也是.
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "gsudo powershell.exe",
"hidden": false
},
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "CMD Shell",
"commandline": "gsudo cmd.exe",
"hidden": false
},