Add -TrustedInstaller switch to Invoke-Gsudo#303
Add -TrustedInstaller switch to Invoke-Gsudo#303God-damnit-all wants to merge 1 commit intogerardog:masterfrom
Conversation
Awesome! Thank you for getting involved.
I like that.
Sorry, I don't understand...
💪
Me too! Actually, I've already started rewriting it some time ago... But I got to a halt. I found a breaking change in the new approach and since I am doing gsudo only in my spare time, I didn't had the time to complete the re-write. To make things 'worse' I accidentally pushed, (and hence released in v2.4.0) the new approach as a new script named Invoke-ElevatedCommand. The script file name was not even meant to be published, I put some alternative name to keep both files at the same time :). The new script focuses on having all gsudo arguments, and using the I didn't released it because The idea was not to release Invoke-ElevatedCommand yet, and replace Invoke-Gsudo with it. The new approach has a powershell native syntax, while also using the brackets/encodedCommand trick (which performs way faster returning serialized objects). So I suggest you take a look at Invoke-ElevatedCommand first and then let me know what things do you think can be improved. |

This allows
-TrustedInstallerto be used to send--tito gsudo.I gave
-TrustedInstallerand-Credentialtheir own parameter sets so they can't be used together. Through this process, I found out that even if you declare them together while using a string for the credential, the credential login from Windows still pops up before stopping you.I removed the use of
$dbgin the Start-Process line and the$userdeclaration since neither variable was being used for anything.Honestly, I'd like to do a more comprehensive re-write of this script at some point.