diff --git a/docs/docs/gsudo-vs-sudo.md b/docs/docs/gsudo-vs-sudo.md index 1517516..a16f17c 100644 --- a/docs/docs/gsudo-vs-sudo.md +++ b/docs/docs/gsudo-vs-sudo.md @@ -21,9 +21,9 @@ Surprisingly, Microsoft's sudo does not leverage new OS features to enhance secu | ------- | ------- | ------------------ | | Executes command with elevated permissions | Yes | Yes | | Supports output redirection (`sudo dir > file.txt`) | Yes | Yes | -| Supports input redirection (`echo md SomeFolder \| sudo cmd`) | Yes | Requires v1.0.0 / Windows insider build 26080 | -| Returns the command exit code | Yes | Requires v1.0.0 / Windows insider build 26080 | -| Preserves the current directory | Yes | [It depends](https://github.com/microsoft/sudo/issues/63) | +| Supports input redirection (`echo md SomeFolder \| sudo cmd`) | Yes | Yes | +| Returns the command exit code | Yes | Yes | +| Preserves the current directory | Yes | Yes, except in new-window mode! ⚠️ [Learn More](https://github.com/microsoft/sudo/issues/63) | | Source code available | [Yes](https://github.com/gerardog/gsudo) | [Yes](https://github.com/microsoft/sudo) | ### Security Impersonation Features @@ -59,13 +59,17 @@ Surprisingly, Microsoft's sudo does not leverage new OS features to enhance secu | Feature | `gsudo` | Sudo for Windows | | ------- | ------- | ------------------ | -| Elevation syntax | `gsudo { scriptblock } -args $a,$b` [syntax](usage/powershell.md#using-gsudo-scriptblock-syntax) | Unknown, possibly: `sudo pwsh { scriptblock } -args $a,$b` | +| Elevation syntax | `gsudo { scriptblock } -args $a,$b` [syntax](usage/powershell.md#using-gsudo-scriptblock-syntax) | `sudo pwsh { scriptblock } -args $a,$b` (Unofficial!) | | Auto-complete of last 3 commands | Yes (with [gsudoModule](usage/powershell.md#gsudo-powershell-module)) | No | -| Auto-complete of options | Yes (with [gsudoModule](usage/powershell.md#gsudo-powershell-module)) | No | +| Auto-complete of command line arguments | Yes (with [gsudoModule](usage/powershell.md#gsudo-powershell-module)) | No | | Red # indicator for elevation | Yes (with [gsudoModule](usage/powershell.md#gsudo-powershell-module)) | No | ## What if I install both? If you have both Microsoft Sudo and `gsudo` installed, they both should work independently. -The `sudo` keyword will run Microsoft's sudo instead of `gsudo` because the typical install of `Sudo for Windows` (which is via a Windows Insider build) puts it in `c:\Windows\System32\sudo.exe`. This folder appears first in the `PATH` environment variable, therefore when running `sudo`, the Microsoft `sudo.exe` will take precedence over gsudo's `sudo` alias. +The `sudo` keyword will run Microsoft's sudo instead of `gsudo` because the typical install of `Sudo for Windows` puts it in `c:\Windows\System32\sudo.exe`. This folder appears first in the `PATH` environment variable, therefore when running `sudo`, the Microsoft `sudo.exe` will take precedence over gsudo's `sudo` alias. + +With the release of `gsudo` v2.5.0, a new configuration setting called `PathPrecedence` has been added. When set to true, it ensures gsudo appears first in the `PATH` variable, making the `sudo` keyword start `gsudo` instead of Microsoft's sudo. To activate, call `gsudo config PathPrecedence true` and restart all consoles to apply the change. Setting it back to `false` will revert to the normal behavior. + +Additionally, gsudo now supports Microsoft sudo styled arguments such as --inline, --disable-input, --preserve-env, --new-window, and -D / --chdir {directory}, ensuring a smoother transition for users familiar with Microsoft sudo.