Unify command execution in sudo.ps1
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.9k
- Forks
- 180
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 2
Description
Description of the new feature / enhancement
There are 3 places in the sudo.ps1 script that execute SUDOEXE in the following manner:
if (($psversiontable.psversion.major -eq 7) -and ($__SUDO_DEBUG -eq $true)) {
Trace-Command -PSHOST -name param* -Expression { & $SUDOEXE ... }
}
else {
& $SUDOEXE ...
}
Maybe export this logic to a function Run-Sudo or something along those lines?
Scenario when this would be used?
Any future change, bugfix, or improvement to the sudo executable or sudo script that need to be addressed at the points of command execution will only need to be applied in 1 place.
Supporting information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in sudo.ps1 and locate the three repeated SUDOEXE execution blocks. Compare their PowerShell 7 debug and normal paths, then centralize that behavior in one helper and replace all three call sites while preserving the existing execution behavior. Done means future command-execution changes can be made in one place.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100