gsudo

Sudo for Windows

MIT License

Stars
5.2K
Committers
24

Bot releases are visible (Hide)

gsudo - gsudo v2.0.2

Published by github-actions[bot] almost 2 years ago

What's Changed

Full Changelog: https://github.com/gerardog/gsudo/compare/v2.0.1...v2.0.2

gsudo - gsudo v2.0.1

Published by github-actions[bot] almost 2 years ago

What's Changed

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

Full Changelog: https://github.com/gerardog/gsudo/compare/v2.0.0...v2.0.1

gsudo - gsudo v2.0.0

Published by github-actions[bot] almost 2 years ago

What's Changed (since v2.0.0-preview release)

  • 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!)

What's Changed (since v1.7.1 - latest Chocolatey/Winget/Scoop version)

  • 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 https://github.com/gerardog/gsudo/pull/188
    gsudo [-u|--user {username}]  [command]
    
  • Feature: Added the ability to force execution in a New Window, and control if that window stays open, by @gerardog in https://github.com/gerardog/gsudo/pull/190
    • Added setting gsudo config NewWindow.Force=true to force every elevation in new window. (Same as using -n every time)
    • Added --KeepWindow: When in new console, ask for keypress before closing the console.
    • Added --KeepShell: Keep the elevated shell open after running {command}.
    • Added setting gsudo config NewWindow.CloseBehaviour: KeepShellOpen (--KeepShell), PressKeyToClose(--KeepWindow), OsDefault to set close behaviour permanently.
  • Added experimental support for NuShell (#152)

  • Config syntax more relaxed now:

    gsudo.exe config loglevel debug
    gsudo.exe config loglevel="debug"
    gsudo.exe config loglevel =  debug
    

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.7.1...v2.0.0-preview

gsudo - gsudo v2.0.0-preview

Published by github-actions[bot] almost 2 years ago

What's Changed

  • 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 https://github.com/gerardog/gsudo/pull/188

    gsudo [-u|--user {username}]  [command]
    
  • Feature: Force NewWindow + --KeepShell + --KeepWindow by @gerardog in https://github.com/gerardog/gsudo/pull/190

    • Added setting gsudo config NewWindow.Force to force every elevation in new window. (Same as using -n every time)
    • Added --KeepShell: Keep elevated shell open after running {command}.
    • Added --KeepWindow: When in new console, ask for keypress before closing the console.
    • Added setting gsudo config NewWindow.CloseBehaviour: KeepShellOpen (--NoExit), PressKeyToClose(--NoClose), OsDefault
  • Added experimental support for NuShell (#152)

  • Config syntax more relaxed now:

    gsudo.exe config loglevel debug
    gsudo.exe config loglevel="debug"
    gsudo.exe config loglevel =  debug
    

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.7.1...v2.0.0-preview

gsudo - gsudo v1.7.1

Published by github-actions[bot] about 2 years ago

What's Changed

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.7.0...v1.7.1

gsudo - gsudo v1.7.0

Published by gerardog about 2 years ago

What's Changed

  • Feature: Follow posix conventions for command line arguments #148 by @gerardog in https://github.com/gerardog/gsudo/pull/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

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.6.0...v1.7.0

gsudo - gsudo v1.6.0

Published by github-actions[bot] about 2 years ago

What's Changed

  • 🚀 Feature: PowerShell new syntax: gsudo { ScriptBlock } by @gerardog in https://github.com/gerardog/gsudo/pull/178
    Read the Docs:

  • Fix: Unified gsudo config PowerShellLoadProfile and $gsudoLoadProfile into the first one. by @gerardog in https://github.com/gerardog/gsudo/pull/175

    gsudo { Get-Process "chrome" }
    gsudo { Get-Process $args } -args "chrome"
    
    $file='C:\My Secret.txt'; 
    $algorithm='md5';
    $hash = gsudo {(Get-FileHash $args[0] -Algorithm $args[1]).Hash} -args $file, $algorithm
    
    # Output can be captured as PSObjects.
    $services = gsudo { Get-Service 'WSearch', 'Winmgmt'} 
    Write-Output $services.DisplayName
    

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.5.1...v1.6.0

gsudo - gsudo v1.5.1

Published by github-actions[bot] about 2 years ago

What's Changed

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.4.1...v1.5.1

gsudo - gsudo v1.5.0

Published by github-actions[bot] about 2 years ago

What's Changed

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.4.1...v1.5.0

gsudo - gsudo v1.4.1

Published by github-actions[bot] about 2 years ago

What's Changed

  • 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

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.4.0...v1.4.1

gsudo - gsudo v1.4.0

Published by github-actions[bot] about 2 years ago

What's Changed

  • 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

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.3.0...v1.4.0

gsudo - gsudo v1.3.1-Feature-NetCore

Published by gerardog about 2 years ago

IMPORTANT: This is an experimental pre-release. Please, only use this version if you feel comfortable trying an experimental version that may have more problems than usual, and you are the kind of person that is willing to report problems as GitHub Issues or in this discussion thread.

In any other case, just use v1.3.0.

Also, the code-signing certificate expired so this version is signed with a self-signed certificate. I was waiting for donations to get a new certificate, and we almost made it so I am purchasing a new one this week.

This pre-release won't be published to WinGet / Scoop / Chocolatey.

Features

  • 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

Full Changelog: https://github.com/gerardog/gsudo/compare/b7865bde46644586e5d978564ccb886ce09aff32...v1.3.1-Feature-NetCore

gsudo - gsudo v1.3.0

Published by gerardog over 2 years ago

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)

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.2.0...v1.3.0

gsudo - gsudo v1.2.0

Published by gerardog over 2 years ago

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)
gsudo - gsudo v1.1.1

Published by gerardog over 2 years ago

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

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.1.0...v1.1.1

gsudo - gsudo v1.1.0

Published by gerardog over 2 years ago

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. (Tip: For now, close all gsudo instances, then gsudo -n -k choco upgrade gsudo)
  • 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.

Full Changelog: https://github.com/gerardog/gsudo/compare/v1.0.2...v1.1.0

gsudo - gsudo v1.0.2

Published by gerardog about 3 years ago

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)
gsudo - gsudo v1.0.1

Published by gerardog about 3 years ago

Fixes:

  • Fixed problem when elevating PowerShell commands with parameters ending in \
gsudo - gsudo v1.0.0

Published by gerardog about 3 years ago

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'.
    For example:
# Before: (<= v0.7.3)
gsudo Get-Item '""C:\Program Files\""'
$hash = gsudo "(Get-FileHash \""$file\"" -Algorithm $algorithm).Hash"
$hash = gsudo '(Get-FileHash \"C:\My Secret.txt\").Hash'
# After: (only standard pwsh escaping rules needed)
gsudo Get-Item "C:\Program Files\"
$hash = gsudo "(Get-FileHash ""$file"" -Algorithm $algorithm).Hash"
$hash = gsudo '(Get-FileHash "C:\My Secret.txt").Hash'
  • 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
gsudo - gsudo v0.7.3

Published by gerardog almost 4 years ago

Fixes:

  • Fixed Failed to load hostfxr.dll when PowerShell is installed via Microsoft Store (#65)
  • Fixed cmd language changed after running gsudo (#63 #67)
  • Fixed cmd elevated color scheme (#51)
  • Fixed exception with gsudo config when gsudo.exe is placed in a path with spaces. (#62)
Badges
Extracted from project README
Join the chat at https://gitter.im/gsudo/community CI Build Chocolatey Downloads GitHub Downloads
Related Projects