Closed hossimo closed 2 months ago
Please enclose your command to elevate in single quotes, or even better: in {}
brackets
You will find this information usefull: https://gerardog.github.io/gsudo/docs/usage/powershell#using-gsudo-scriptblock-syntax
Thanks so much for answering, Typical RTFM for me :)
Thanks again this has been a real help! now I just need to make an alias for !!
Lol, happy to help :)
And btw, don't make an alias for !!
, write gsudo
, press space, and then press tab, for example:
PS C:\> echo something
something
PS C:\> sudo [press tab key]
PS C:\> sudo { echo something } # magic autocomplete
(this requires Import-Module gsudoModule
in your profile )
Amazing! Thanks so much again! I'm so glad this will be in Windows by default. I bounce between Windows, Mac and Debian constantly and this is a huge help for my mental gymnastics.
Microsoft's sudo is like 2019's gsudo. You may still want to run winget install gsudo
;)
Issue Description
I get different results from an elevated Powershell vs a Normal one, this seems to happen when I use a Command that requires a $True or $False parameter.
Steps to Reproduce
gsudo Disable-NetAdapter -Name "Ethernet" -Confirm:$False
However, if I run the same command from an elevated (obviously without (g)sudo) PowerShell it works correctly:
It almost looks like the gsudo is converting the $False to a string "False"
Screenshots
Working from Elevated:![image](https://github.com/gerardog/gsudo/assets/1986602/fe0d251a-12e7-44d9-9f16-f201081cf1ce)
Not working from Normal PS:![image](https://github.com/gerardog/gsudo/assets/1986602/227e45af-ab94-4fa4-aaf6-608257c1e4e3)
Context: