cmderdev / cmder

Lovely console emulator package for Windows
https://cmder.app
MIT License
25.69k stars 2.02k forks source link

[Bug] Predefined task: as Admin #2929

Open xiaoxstz opened 4 months ago

xiaoxstz commented 4 months ago

Version Information

Cmder version:`1.3.24`
Operating system: Windows 10 Pro(22H2)

Cmder Edition

Cmder Mini

Description of the issue

The predefined task PowerShell::Powershell as Admin (show below)cannot open Powershell as admin

*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%..\profile.ps1'''"

The predefined task cmd::Cmder as Admin (show below) cannot open Powershell as admin

*cmd /k ""%ConEmuDir%..\init.bat" "

How to reproduce

image

image

Additional context

I have a solution for PowerShell::Powershell as Admin . Change the setting to below

powershell.exe -new_console:a -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%..\profile.ps1'''"

The key point is the parameter -new_console:a

Checklist