cmderdev / cmderdev/cmder

[Bug] Predefined task: as Admin

Open
#2,929 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 Type: Bug 🤝 Help wanted
Dominant language
PowerShell
Stars
27k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

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
  • I have read the documentation.
  • I have searched for similar issues and found none that describe my issue.
  • I have reproduced the issue on the latest version of Cmder.
  • I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the predefined task configuration for the entries PowerShell::Powershell as Admin and cmd::Cmder as Admin, using their displayed command strings as search terms. Check how the -new_console:a parameter is handled and reproduce both tasks on Windows 10. Done means the affected predefined tasks open the intended elevated shell.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.