sudo icon indicating copy to clipboard operation
sudo copied to clipboard

Unify command execution in sudo.ps1

Open shailist opened this issue 1 year ago • 1 comments

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

shailist avatar Feb 12 '24 02:02 shailist

Thanks for your feedback! I've added this to our backlog.

joadoumie avatar Feb 28 '24 20:02 joadoumie