gsudo Changelog

What's new in gsudo 2.4.4

Feb 26, 2024
  • Proper fix for WSL wrapper will not work if gsudo is on different drive

New in gsudo 2.4.2 (Dec 18, 2023)

  • Fix Error: Invalid option: -noninteractive using gsudo {command} on Visual Studio code by @gerardog in #306
  • Fix issue in system/trusted-installer credentials cache support by @gerardog in #323

New in gsudo 2.4.1 Pre-release (Oct 1, 2023)

  • What's Changed:
  • The code signing certificate expired, so I've applied the one donated by @parag_c_meta & signmycode.com. Please be patient until this certificate gets downloads and reputation on Antivirus vendors. Please report false positives!
  • Fix for #305 "Error: Invalid option: -noninteractive" running gsudo {command} on VSCode.
  • Docs:
  • Docs: improve README.md manual installation technique, fixes #296 by @rfay in #299
  • Docs: Include Nushell on homepage by @connorjs in #304

New in gsudo 2.4.0 (Aug 28, 2023)

  • Improved scripting scenarios by @gerardog in #286
  • gsudo status {key} returns exit code for booleans: 0(success) for true, 1(fail) for false
  • Added --no-output to gsudo status {key} to suppress output.
  • Fixed issue on Cache ON not propagating --LogLevel or --Duration if cache was already active
  • Added sample usage scripts and updated docs
  • For example:
  • gsudo status IsElevated --no-output && echo "This process is elevated!"
  • Fix Error: Unable to connect to the elevated service/NullReferenceException by @gerardog in #292
  • Preserve console title after gsudo exit (#266) by @gerardog in #294

New in gsudo 2.3.0 (Jul 18, 2023)

  • What's Changed:
  • Add JSON format to gsudo status --json by @gerardog in #276
  • Fetch a single status value using gsudo status {key}
  • E.g. gsudo status CacheAvailable
  • Fixed PowerShell Module install location to support Windows Powershell too by @gerardog in #278

New in gsudo 2.2.0 (Jul 17, 2023)

  • PowerShell Module Improvements by @gerardog in #275
  • The module can now be imported simply with Import-Module gsudoModule, eliminating the requirement for a full absolute path. Existing scripts using absolute paths will continue to work as expected.
  • ...because both the .MSI and Chocolatey installers now deploy the module files also to %ProgramFiles%PowerShellModulesgsudoModule.
  • The module version number is now properly updated with the build version.

New in gsudo 2.1.0 (Jul 9, 2023)

  • Improvements in gsudo PowerShell Module
  • Added PowerShell syntax suggestions and auto-complete for gsudo (#233)
  • Added PowerShell functions:
  • Test-IsProcessElevated function, returns true if elevated.
  • Test-IsAdminMember function, returns true if user is member of the Local Administrators group, regardless of the elevation status.
  • gsudoPrompt function to add a red # to the prompt if user is admin. Requires the user to add: Set-Alias prompt gsudoPrompt in their $PROFILE to activate.
  • gsudo prompt
  • Improved Get-Help gsudo
  • Fixed quotation issue when elevating a command with the first and last word has quotes.

New in gsudo 2.0.10 (Jun 5, 2023)

  • Bugfix: Fix for --copyns error reconnecting network path with spaces by @nurfed1 in #268

New in gsudo 2.0.9 Pre-release (May 1, 2023)

  • Fix for Prevent WSL to default to Windows directory (#260).
  • image

New in gsudo 2.0.8 (Apr 30, 2023)

  • Fixed wsl error line 11: /mnt/c/Program: No such file or directory by @gerardog in #259

New in gsudo 2.0.7 (Apr 28, 2023)

  • What's Changed:
  • Feature: Added support for BusyBox's sh, ash & bash by @gerardog in #255
  • Fix call to bash wrapper gsudo without PATH env var set by @lsiu in #249

New in gsudo 2.0.6 (Mar 25, 2023)

  • Fixed Windows 7 issue enumerating named pipes by @gerardog in #218
  • Fixed cache when invoked via Shim by @gerardog in #238
  • Changes in MSI installer:
  • One installer per Platform (x86, x64 & arm64) using Wix v4 by @BMurri in #244 #245
  • This also means it now installs to ProgramFiles instead of Program Files (x86)
  • Allows to use gsudo to install a new gsudo version using WinGet (for Scoop/Choco that was already possible)
  • Files are now copied to a version specific version %ProgramFiles%gsudov2.x.x
  • Creates a symlink `%ProgramFiles%gsudoCurrent that links to vX.X.X
  • BREAKING CHANGE: If you added gsudo module to your Powershell profile update its path to %ProgramFiles%gsudoCurrent or even better just do Import-Module (Get-Command gsudoModule.psd1).Path and let it pick up from your PATH variable.

New in gsudo 2.0.5 Pre-release (Nov 23, 2022)

  • Changes in MSI installer:
  • Installs to %ProgramFiles(x86)%gsudovX.X.X
  • Creates a symlink %ProgramFiles(x86)%gsudoCurrent that links to vX.X.X
  • This allows to use gsudo to install a new gsudo version using WinGet (for Scoop/Choco that was already possible)
  • Gsudo winget upgrade gsudo
  • Changes in Chocolatey package:
  • This version no longer uses a custom Chocolatey installer, so not installing to C:toolsgsudov2.x.x anymore
  • Instead, it uses the official gsudoSetup.MSI included in this release. (Mentioned above)
  • This means, for example, that even if you install with choco install gsudo, you can uninstall or upgrade with winget. Or uninstall with add or remove programs.
  • Scoop not affected.

New in gsudo 2.0.4 (Nov 21, 2022)

  • Fix hang on Pwsh installed as a dotnet global tool #211

New in gsudo 2.0.3 (Nov 18, 2022)

  • What's Changed:
  • Fix for the breaking changes included in Powershell Core v7.3 by @gerardog in #208

New in gsudo 2.0.2 (Nov 10, 2022)

  • Fixed issue with --copyEV by @gerardog in #202

New in gsudo 2.0.1 (Nov 8, 2022)

  • Fixed #199: --copyev throws System.IO.IOException
  • Fixed gsudo --help text
  • Nicer error message on UAC cancel

New in gsudo 2.0.0 (Nov 7, 2022)

  • Fixed #196: Credential cache status is displayed incorrectly
  • Fixed an issue where the credentials cache fails to start and restarts in a loop. (thanks dmagician!)

New in gsudo 2.0.0 Pre-release (Oct 23, 2022)

  • Several new features and some refactoring justified a new mayor version. Pre-release open for wider user testing.
  • Add the ability to run a shell or command as a specific user, even if the user is not a local machine admin. By @gerardog in #188
  • Gsudo [-u|--user {username}] [command]
  • Feature: Force NewWindow + --NoClose + --NoExit by @gerardog in #190
  • Added setting gsudo config NewWindow.Force to force every elevation in new window. Same as using -n every time.
  • Added --NoExit: Keep elevated shell open after running {command}.
  • Added --NoClose: When in new console, ask for keypress before closing the console.
  • Added setting gsudo config NewWindow.CloseBehaviour: KeepShellOpen (--NoExit), PressKeyToClose(--NoClose), OsDefault
  • Config syntax more relaxed now:
  • Gsudo.exe config loglevel debug
  • Gsudo.exe config loglevel=debug
  • Gsudo.exe config loglevel="debug"
  • Gsudo.exe config loglevel = debug

New in gsudo 1.7.1 (Oct 2, 2022)

  • Fix elevations problems with Windows PowerShell (#180) and Notepad (#131) by @gerardog in #181

New in gsudo 1.7.0 (Sep 28, 2022)

  • Feature: Follow posix conventions for command line arguments #148 by @gerardog in #179
  • Short options without arguments can be grouped (gsudo -n -w -d => gsudo -nwd)
  • Short options with arguments now accepts space/no-space/equals as separator ( gsudo -i Low => gsudo -iLow or gsudo -i=Low )
  • For example gsudo -i Low -n -w -d --debug MyProgram.exe can now be written as
  • gsudo -iLow -nwd --debug MyProgram.exe allowed
  • gsudo -i=Low -nwd --debug MyProgram.exe allowed
  • gsudo -i Low -nwd --debug MyProgram.exe allowed

New in gsudo 1.6.0 (Sep 21, 2022)

  • Fix: Unified gsudo config PowerShellLoadProfile and $gsudoLoadProfile into the first one. by @gerardog in #175
  • Feature: PowerShell new syntax: gsudo { ScriptBlock } by @gerardog in #178

New in gsudo 1.5.1 (Sep 9, 2022)

  • Feature: gsudo --ti to run as TrustedInstaller.
  • Fix: Elevation to System from non-admin account.

New in gsudo 1.5.0 Pre-release (Sep 6, 2022)

  • Feature: Added gsudo --ti to run as TrustedInstaller by @gerardog in #163

New in gsudo 1.4.1 (Sep 6, 2022)

  • Fix(UnauthorizedAccessException): when elevating as someone else twice from same parent process (eg, WT elevated tabs) #150
  • Fix(Simultaneous elevations): Fix cache for simultaneous elevations from one parent process (eg. WT tabs) #145
  • Fix(Cache): Fix cache on finishing before the cache is available. Fixes #144
  • Fix(Hang): Limit recursion seeking parent pid #155
  • Fix(VT mode): Send correct cursor pos on Vt init 48261ec
  • Chore: Removed hardcoded Cmd commands that actually are .EXE apps 2f47f3e

New in gsudo 1.4.1 Pre-release (Sep 5, 2022)

  • Fix(UnauthorizedAccessException): when elevating as someone else twice from same parent process (eg, WT elevated tabs)
  • Fix(Simultaneous elevations): Fix cache for simultaneous elevations from one parent process (eg. WT tabs)
  • Fix(Cache): Fix cache on finishing before the cache is available.
  • Fix(Hang): Limit recursion seeking parent pid
  • Fix(VT mode): Send correct cursor pos on Vt init
  • Chore: Removed hardcoded Cmd commands that actually are .EXE apps

New in gsudo 1.4.0 (Sep 5, 2022)

  • Migrated to .Net 7.0
  • Faster performance (38% for x64, 14% for x86)
  • Native build (No need to have any .Net Runtime installed). This also means different versions for x86 and x64 OS. Use the one matching your system. The gsudoSetup.msi installs the correct version automatically.
  • Details in this blog post
  • This release is the similar to the v1.3.1-Feature-NetCore prerelease, but properly signed with the new code signing certificate.
  • Thank you so much to all the sponsors that made it possible!! We will need a renew the certificate in exactly one year, so your donations are appreciated!
  • New GitHub Actions pipeline for (hopefully faster) Build, Test & Release

New in gsudo 1.3.1 Pre-release (Sep 4, 2022)

  • Migrated to .Net 7.0
  • Faster performance (38% for x64, 14% for x86)
  • Native build (No need to have any .Net Runtime installed). This also means different versions for x86 and x64 OS. Use the one matching your system. The gsudoSetup.msi installs the correct version automatically.
  • Details in this blog post

New in gsudo 1.3.1 Pre-release (Aug 28, 2022)

  • Migrated to .Net 7.0:
  • Faster performance (38% for x64, 14% for x86)
  • Native build (No need to have any .Net Runtime installed). This also means different versions for x86 and x64 processors. Use the one matching your system. The gsudoSetup.msi installs the correct version automatically.
  • Details in this blog post

New in gsudo 1.3.0 (Apr 13, 2022)

  • Features:
  • Git-Bash/MinGW Improvements:
  • Proper elevations of commands as bash commands (unless -d is specified)
  • For example: gsudo ls /etc/hosts will elevate bash -c "ls /etc/hosts" instead of cmd /c ls.exe "C:/Program Files/Git/etc/hosts"
  • Fixed algorithm to define which parent process will be the allowed cache root. #134
  • Still the Credentials Cache may not work in MinGW unless you add this function to your .bashrc profile:
  • gsudo() { WSLENV=WSL_DISTRO_NAME:USER:$WSLENV MSYS_NO_PATHCONV=1 gsudo.exe "$@"; }
  • Fixed issues with Shell detection. (7f9d55b)
  • Disable Git-Bash/MinGW param translation on elevation(cd12fe4)
  • Fixes:
  • WSL: Force reset color after gsudo ends. (b047df6)
  • Fixed gsudo bash script missing on Chocolatey package (aebd731)
  • Show received command line in debug information when --debug is specified. (086777c)

New in gsudo 1.2.0 (Mar 25, 2022)

  • Features:
  • PowerShell: Allow to optionally load PS profiles when elevating simple commands. #130
  • For gsudo, use gsudo --loadProfile command per command, or gsudo config PowerShellLoadProfile true for permanent configuration.
  • For Invoke-Gsudo: use Invoke-gsudo { scriptBlock } -LoadProfile per command, or set $gsudoLoadProfile=$true in your $PROFILE after Import-Module gsudoModule for permanent configuration.
  • For best results, if you enable this feature, your $PROFILE should not write any output to the console.
  • Fixes:
  • Do not change Console encoding, because it alters the parent Console Host CodePage even after gsudo is closed. Fixes issues with Asian/double-byte character set (DBCS) setups. (fixes #129)

New in gsudo 1.1.1 (Mar 12, 2022)

  • Fixes:
  • Improved support for elevation when current user is not admin, including PowerShell Invoke-gsudo cmdlet support #113
  • This is the scenario where gsudo's UAC popup asks for a different set of credentials.
  • The change consists into proper launching the elevated process in the admin user context.
  • Internally this means the default 'TokenSwitch' gsudo mode is not suitable for this scenario, so we fallback to Attached mode (for interactive consoles) or Piped (for Invoke-gsudo cmdlet or In/Out/Err redirection).
  • Piped Mode:
  • Fix encoding issues.
  • Close elevated StdIn when closed by client.
  • Allow local-echo if StdIn is redirected.
  • When --copyEV is used, the %UserName% variable is not copied.
  • gsudo -n -k now open the new window after closing credentials cache (-k)
  • gsudo PowerShell module now includes proper version number in gsudoModule.psd1 #127
  • Chocolatey: Fixed choco upgrade/uninstall when current directory is gsudo directory

New in gsudo 1.1.0 (Feb 27, 2022)

  • Features:
  • Improved PowerShell elevation syntax with a wrapper function Invoke-gsudo #39: See the readme. For example:
  • Get-process SpoolSv | Invoke-gsudo { Stop-Process -Force }
  • Added gsudo !! for PowerShell to elevate the last command. #44 Requires importing gsudoModule.psm1 as explained in the readme
  • Added support for Take Command shell #107
  • Fixes:
  • Fixed Unable to install/uninstall Chocolatey package if gsudo is running #74: Unfortunately, you still need to close gsudo before upgrading to this release, but for the next one you may gsudo choco upgrade gsudo, I promise.
  • TokenSwith mode: Using a more restrictive security descriptor for process handles, to reduce security exposure and process handle leak.
  • Attached mode: Fixed Ctrl-C handler and redirection.
  • VT mode: Fixed redirection.

New in gsudo 1.0.2 (Aug 19, 2021)

  • Fixes:
  • Fixed 'gsudo cache' auto-elevation on PowerShell when path has spaces.
  • Fixed Cache auto not working with sudo alias or msys (#98)
  • gsudo failing in PowerShell with ExecutionPolicy=Restricted. (#101)
  • Fixed Ctrl-C Handling on de-elevation (#103)

New in gsudo 1.0.1 (Aug 7, 2021)

  • Fixed problem when elevating PowerShell commands with parameters ending in

New in gsudo 1.0.0 (Aug 7, 2021)

  • Features:
  • Improved elevation of Bash commands #56: [BREAKING CHANGE] No more need to make additional character escaping (like " to "). Now most commands can be elevated by prepending 'gsudo'.
  • Improved elevation of WSL commands #55: [BREAKING CHANGE] Now prepend gsudo (.exe not required) to elevate WSL native commands (instead of CMD commands), or use gsudo -d {cmd} to elevate CMD commands.
  • Added -d/--direct to bypass the shell wrapper (i.e. powershell/bash/wsl) (#80) and interpret the command to elevate as a Windows / CMD app.
  • For example if you do gsudo notepad C:file.txt from powershell, it will launch another powershell instance to resolve possible PS aliases/commands. (i.e. 'powershell.exe -Command notepad'). But if you add '-d' (gsudo -d notepad) it will expect a CMD/Windows command, so it will launch notepad.exe from the path directly (also a little bit faster).
  • Fixes:
  • gsudo config fails on auto-elevation #62 + #93
  • Microsoft Store Apps fail to elevate if command line has quotes #78
  • Removed Administrator: prefix from console title on de-elevations. #91
  • gsudo launches a 64 bit cmd when ran in a 32-bit cmd #92
  • Bad command prompt on Windows 8.1 #30
  • 'Process exited with code' message now only shown in Debug mode

New in gsudo 1.0.0 Pre-release (Aug 2, 2021)

  • Features:
  • [BREAKING] Improved PowerShell elevation syntax: No more need to make additional character escapin (like " to "). Now most commands can be
  • [BREAKING] Improved WSL elevation syntax: Now prepend gsudo (.exe now optional) to elevate WSL commands. or gsudo -d {cmd} to elevate CMD commands.
  • Added -d/--direct to bypass the shell wrapper (powershell/bash/wsl) and treat the command to elevate as a CMD app. For example gsudo -d notepad C:file.txt from powershell (or wsl or bash, for that matter) lets gsudo know doesn't need to use a new powershell instance to access powershell aliases to resolve notepad, and just let it find and launch notepad.exe from the path. Also, avoiding that extra powershell call means faster load times.
  • Fixes:
  • Removed Administrator: prefix from console title on de-elevations.
  • Keep 32 bit context when launched from 32bit CMD on x64.
  • 'Process exited with code' message now only shown in Debug mod

New in gsudo 0.7.2 (Nov 14, 2020)

  • Fix Unhandled Exception when pressing CTRL+C after ~4 minutes runtime (Ctrl-C Handler delegate was garbage collected). (#53)
  • Fix Choco package issue when the user is not admin and installs as another user (#50)
  • Fix gsudo red ´#´ CMD prompt breaking console color scheme on some scenarios (#51)
  • Fix gsudo !prefix now case insensitive.