Downloads:
421,895
Downloads of v 1.2.1-alpha11:
80
Last Update:
12 Apr 2022
Package Maintainer(s):
Software Author(s):
- Gerardo Grignoli
Tags:
sudo for windows run elevated user command runas powershell wsl- Software Specific:
- Software Site
- Software Source
- Software License
- Software Docs
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
gsudo - a sudo for windows
This is a prerelease version of gsudo - a sudo for windows.
- 1
- 2
- 3
1.2.1-alpha11 | Updated: 12 Apr 2022
- Software Specific:
- Software Site
- Software Source
- Software License
- Software Docs
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Downloads:
421,895
Downloads of v 1.2.1-alpha11:
80
Maintainer(s):
Software Author(s):
- Gerardo Grignoli
gsudo - a sudo for windows 1.2.1-alpha11
This is a prerelease version of gsudo - a sudo for windows.
Legal Disclaimer: Neither this package nor Chocolatey Software, Inc. are affiliated with or endorsed by Gerardo Grignoli. The inclusion of Gerardo Grignoli trademark(s), if any, upon this webpage is solely to identify Gerardo Grignoli goods or services and not for commercial purposes.
- 1
- 2
- 3
Some Checks Have Failed or Are Not Yet Complete
Not All Tests Have Passed
Deployment Method: Individual Install, Upgrade, & Uninstall
To install gsudo - a sudo for windows, run the following command from the command line or from PowerShell:
To upgrade gsudo - a sudo for windows, run the following command from the command line or from PowerShell:
To uninstall gsudo - a sudo for windows, run the following command from the command line or from PowerShell:
Deployment Method:
This applies to both open source and commercial editions of Chocolatey.
1. Enter Your Internal Repository Url
(this should look similar to https://community.chocolatey.org/api/v2/)
2. Setup Your Environment
1. Ensure you are set for organizational deployment
Please see the organizational deployment guide
2. Get the package into your environment
Option 1: Cached Package (Unreliable, Requires Internet - Same As Community)-
Open Source or Commercial:
- Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://community.chocolatey.org/api/v2/. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
- You can also just download the package and push it to a repository Download
-
Open Source
-
Download the package:
Download - Follow manual internalization instructions
-
-
Package Internalizer (C4B)
-
Run: (additional options)
choco download gsudo --internalize --version=1.2.1-alpha11 --pre --source=https://community.chocolatey.org/api/v2/
-
For package and dependencies run:
choco push --source="'INTERNAL REPO URL'"
- Automate package internalization
-
Run: (additional options)
3. Copy Your Script
choco upgrade gsudo -y --source="'INTERNAL REPO URL'" --version="'1.2.1-alpha11'" --prerelease [other options]
See options you can pass to upgrade.
See best practices for scripting.
Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.
If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:
choco upgrade gsudo -y --source="'INTERNAL REPO URL'" --version="'1.2.1-alpha11'" --prerelease
$exitCode = $LASTEXITCODE
Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
Exit 0
}
Exit $exitCode
- name: Install gsudo
win_chocolatey:
name: gsudo
version: '1.2.1-alpha11'
source: INTERNAL REPO URL
state: present
allow_prerelease: yes
See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.
chocolatey_package 'gsudo' do
action :install
source 'INTERNAL REPO URL'
version '1.2.1-alpha11'
options '--prerelease'
end
See docs at https://docs.chef.io/resource_chocolatey_package.html.
cChocoPackageInstaller gsudo
{
Name = "gsudo"
Version = "1.2.1-alpha11"
Source = "INTERNAL REPO URL"
chocoParams = "--prerelease"
}
Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.
package { 'gsudo':
ensure => '1.2.1-alpha11',
install_options => ['--prerelease'],
provider => 'chocolatey',
source => 'INTERNAL REPO URL',
}
Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.
4. If applicable - Chocolatey configuration/installation
See infrastructure management matrix for Chocolatey configuration elements and examples.
This package was approved as a trusted package on 13 Apr 2022.
gsudo
allows to run commands with elevated permissions within the current console.
It is a sudo
equivalent for Windows, with a similar user-experience as the original *nix sudo.
Elevated commands are shown in the caller (non-elevated) console, no switching to another console required.
http://github.com/gerardog/gsudo
Usage
gsudo [command] [arguments]
Executes the specified command, elevated, and returns.
Examples
gsudo notepad c:\Windows\System32\drivers\etc\hosts
gsudo cmd
md5: 1BAD7FA956379198597DEFEDFE9FA13A | sha1: 15758C89B20253CEA56D7D0B6CA44D12BDFDE552 | sha256: 30FB06A29969B2CEC53FBA7D4BEBE0F58CA887CD30F11AE1B2FD1B4F9988AB66 | sha512: 96826D7D6DE437348C90627872379571AB3B2515B77FEEF2B4EBF0EC0FCDBA24DCB8AF80E59BC29AEDA3A82D5CFC4B2ECBE62A1F17C72F6DBE6E59C80FBC31A9
#
# Module manifest for module 'gsudoModule'
#
# Generated by: Gerardo Grignoli
#
# Generated on: 2/1/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'gsudoModule.psm1'
# Version number of this module.
ModuleVersion = "1.2.1"
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely identify this module
GUID = 'c50a89c0-75c0-4b08-8dac-473404b73379'
# Author of this module
Author = 'Gerardo Grignoli'
# Company or vendor of this module
CompanyName = 'gsudo'
# Copyright statement for this module
Copyright = '(c) Gerardo Grignoli. All rights reserved.'
# Description of the functionality provided by this module
# Description = ''
# Minimum version of the PowerShell engine required by this module
# PowerShellVersion = ''
# Name of the PowerShell host required by this module
# PowerShellHostName = ''
# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'gsudo', 'invoke-gsudo'
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
# Variables to export from this module
VariablesToExport = 'gsudoVerbose', 'gsudoLoadProfile'
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()
# DSC resources to export from this module
# DscResourcesToExport = @()
# List of all modules packaged with this module
# ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()
# A URL to the license for this module.
# LicenseUri = ''
# A URL to the main website for this project.
# ProjectUri = ''
# A URL to an icon representing this module.
# IconUri = ''
# ReleaseNotes of this module
# ReleaseNotes = ''
# Prerelease string of this module
# Prerelease = ''
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false
# External dependent modules of this module
# ExternalModuleDependencies = @()
} # End of PSData hashtable
} # End of PrivateData hashtable
# HelpInfo URI of this module
# HelpInfoURI = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
}
$c = @("function Invoke-Gsudo {")
$c += (Get-Content "$PSScriptRoot\Invoke-Gsudo.ps1")
$c += "}"
iex ($c -join "`n" | Out-String)
function gsudo {
$invocationLine = $MyInvocation.Line -replace "^$($MyInvocation.InvocationName)\s+" # -replace '"','""'
if ($invocationLine -match "(^| )!!( |$)")
{
$i = 0;
do {
$c = (Get-History | Select-Object -last 1 -skip $i).CommandLine
$i++;
} while ($c -eq $MyInvocation.Line -and $c)
if ($c) {
if ($gsudoVerbose) { Write-verbose "Elevating Command: '$c'" -Verbose}
gsudo.exe $c
}
else {
throw "Failed to find last invoked command in Powershell history."
}
}
elseif($myinvocation.expectingInput) {
$input | & gsudo.exe @args
}
else {
& gsudo.exe @args
}
}
$gsudoVerbose=$true;
# On your $PROFILE set $gsudoLoadProfile=$true to make invoke-gsudo load your profile.
# Warning: If you do, then do not write to console/Out on your $profile or else that lines will appear in your Invoke-gsudo result.
$gsudoLoadProfile=$false;
Export-ModuleMember -function Invoke-Gsudo, gsudo -Variable gsudoVerbose, gsudoLoadProfile
<#
.SYNOPSIS
Executes a ScriptBlock in a new elevated instance of powershell, using `gsudo`.
.DESCRIPTION
Serializes a scriptblock and executes it in an elevated powershell.
The ScriptBlock runs in a different process, so it can´t read/write variables from the invoking scope.
If you reference a variable in a scriptblock using the `$using:variableName` it will be replaced with it´s serialized value.
The elevated command can accept input from the pipeline with $Input. It will be serialized, so size matters.
The script result is serialized, sent back to the non-elevated instance, and returned.
Optionally you can check for "$LastExitCode -eq 999" to find out if gsudo failed to elevate (UAC popup cancelled)
.PARAMETER ScriptBlock
Specifies a ScriptBlock that will be run in an elevated PowerShell instance. '
e.g. { Get-Process Notepad }
.PARAMETER ArgumentList
An list of elements that will be accesible inside the script as: $args
.PARAMETER NoElevate
A test mode where the command is executed out-of-scope but without real elevation: The serialization/marshalling is still done.
.INPUTS
You can pipe any object to Invoke-Gsudo. It will be serialized and available in the userScript as $Input.
.OUTPUTS
Whatever the scriptblock returns. Use explicit "return" in your scriptblock.
.EXAMPLE
PS> Get-Process notepad | Invoke-gsudo { Stop-Process }
PS> Invoke-gsudo { return Get-Content 'C:\My Secret Folder\My Secret.txt'}
PS> $a=1; $b = Invoke-gsudo { $using:a+10 }; Write-Host "Sum returned: $b";
Sum returned: 11
.LINK
https://github.com/gerardog/gsudo
#>
[CmdletBinding(DefaultParameterSetName = 'None')]
param
(
# The script block to execute in an elevated context.
[Parameter(Mandatory = $true, Position = 0)]
[System.Management.Automation.ScriptBlock]
$ScriptBlock,
# Optional argument list for the program or the script block.
[Parameter(Mandatory = $false, Position = 1)]
[System.Object[]]
$ArgumentList,
[Parameter(ValueFromPipeline)]
[pscustomobject]
$InputObject,
[Parameter()]
[switch]
$LoadProfile = $false,
#test mode
[Parameter()]
[switch]
$NoElevate = $false
)
# Replaces $using:variableName with the serialized value of $variableName.
# Credit: https://stackoverflow.com/a/60583163/97471
Function Serialize-Scriptblock
{
param(
[scriptblock]$Scriptblock
)
$rxp = '(?<!`)\$using:(?<var>\w+)'
$ssb = $Scriptblock.ToString()
$cb = {
$v = (Get-Variable -Name $args[0].Groups['var'] -ValueOnly)
if ($v -eq $null)
{ '$null' }
else
{
"`$([System.Management.Automation.PSSerializer]::Deserialize([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('{0}'))))" -f [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([System.Management.Automation.PSSerializer]::Serialize($v)))
}
}
$sb = [RegEx]::Replace($ssb, $rxp, $cb, [System.Text.RegularExpressions.RegexOptions]::IgnoreCase);
return $sb;
}
Function Deserialize-Scriptblock
{
param(
[string]$sb
)
[Scriptblock]::Create($sb).GetNewClosure()
}
$expectingInput = $myInvocation.expectingInput;
$debug = if ($PSBoundParameters['Debug']) {$true} else {$false};
$userScriptBlock = Serialize-Scriptblock $ScriptBlock
$InputArray = $Input
$location = (Get-Location).Path;
if($PSBoundParameters["ErrorAction"]) {
#Write-Verbose -verbose "Received ErrorAction $($PSBoundParameters["ErrorAction"])"
$errorAction = $PSBoundParameters["ErrorAction"] | Out-String
} else {
#Write-Verbose -verbose "ErrorActionPreference is $ErrorActionPreference"
$errorAction = $ErrorActionPreference | Out-String
}
$remoteCmd = Serialize-Scriptblock {
$InputObject = $using:InputArray;
$argumentList = $using:ArgumentList;
$expectingInput = $using:expectingInput;
$sb = [Scriptblock]::Create($using:userScriptBlock);
Set-Location $using:location;
$ErrorActionPreference=$using:errorAction;
if ($expectingInput) {
try {
($InputObject | Invoke-Command $sb -ArgumentList $argumentList)
} catch {throw $_}
} else {
try{
(Invoke-Command $sb -ArgumentList $argumentList)
} catch {throw $_}
}
}
if ($Debug) {
Write-Debug "User ScriptBlock : $userScriptBlock"
Write-Debug "Full Script to run on the isolated instance: { $remoteCmd }"
}
if($NoElevate) {
# We could invoke using Invoke-Command:
# $result = $InputObject | Invoke-Command (Deserialize-Scriptblock $remoteCmd) -ArgumentList $ArgumentList
# Or run in a Job to ensure same variable isolation:
$job = Start-Job -ScriptBlock (Deserialize-Scriptblock $remoteCmd) -errorAction $errorAction | Wait-Job;
$result = Receive-Job $job -errorAction $errorAction
} else {
$pwsh = ("""$([System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName)""") # Get same running powershell EXE.
if ($host.Name -notmatch 'consolehost') { # Workaround for PowerShell ISE, or PS hosted inside other process
if ($PSVersionTable.PSVersion.Major -le 5)
{ $pwsh = "powershell.exe" }
else
{ $pwsh = "pwsh.exe" }
}
$windowTitle = $host.ui.RawUI.WindowTitle;
$dbg = if ($debug) {"--debug "} else {" "}
$NoProfile = if ($gsudoLoadProfile -or $LoadProfile) {""} else {"-NoProfile "}
$arguments = "-d $dbg--LogLevel Error $pwsh -nologo $NoProfile-NonInteractive -OutputFormat Xml -InputFormat Text -encodedCommand IAAoACQAaQBuAHAAdQB0ACAAfAAgAE8AdQB0AC0AUwB0AHIAaQBuAGcAKQAgAHwAIABpAGUAeAAgAA==".Split(" ")
# Must Read: https://stackoverflow.com/questions/68136128/how-do-i-call-the-powershell-cli-robustly-with-respect-to-character-encoding-i?noredirect=1&lq=1
$result = $remoteCmd | & gsudo.exe $arguments *>&1
$host.ui.RawUI.WindowTitle = $windowTitle;
}
ForEach ($item in $result)
{
if (
$item.Exception.SerializedRemoteException.WasThrownFromThrowStatement -or
$item.Exception.WasThrownFromThrowStatement
)
{
throw $item
}
if ($item -is [System.Management.Automation.ErrorRecord])
{
Write-Error $item
}
else
{
Write-Output $item;
}
}
$ErrorActionPreference = 'Ignore'
if (Get-Process gsudo 2> $null) {
if (Get-Command gsudo.exe 2> $null) {
# Stop any gsudo open cache sessions, if any.
gsudo.exe -k 2> $null
Start-Sleep -Milliseconds 500
}
}
$ToolsLocation = Get-ToolsLocation
if ([System.Environment]::CurrentDirectory -like "$ToolsLocation*") {
Write-Output -Verbose "Changing directory to $ToolsLocation to ensure successfull install/upgrade."
Set-Location $ToolsLocation
}
$ErrorActionPreference = 'Continue'
Import-Module (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "Uninstall-ChocolateyPath.psm1")
function MarkFileDelete {
param(
[parameter(Mandatory=$true)]
[string] $path
)
# the code below has been used from
# https://blogs.technet.com/b/heyscriptingguy/archive/2013/10/19/weekend-scripter-use-powershell-and-pinvoke-to-remove-stubborn-files.aspx
# with inspiration from
# http://www.leeholmes.com/blog/2009/02/17/moving-and-deleting-really-locked-files-in-powershell/
# and error handling from
# https://blogs.technet.com/b/heyscriptingguy/archive/2013/06/25/use-powershell-to-interact-with-the-windows-api-part-1.aspx
Add-Type @'
using System;
using System.Text;
using System.Runtime.InteropServices;
public class Posh
{
public enum MoveFileFlags
{
MOVEFILE_DELAY_UNTIL_REBOOT = 0x00000004
}
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, MoveFileFlags dwFlags);
public static bool MarkFileDelete (string sourcefile)
{
return MoveFileEx(sourcefile, null, MoveFileFlags.MOVEFILE_DELAY_UNTIL_REBOOT);
}
}
'@
$deleteResult = [Posh]::MarkFileDelete($path)
if ($deleteResult) {
write-Warning "(Delete of $path failed: Will be deleted at next boot.)"
} else {
write-Warning "(Error marking $path for deletion at next boot.)"
}
}
$installPath = "$(Get-ToolsLocation)\gsudo"
Uninstall-ChocolateyPath "$installPath\Current" 'Machine'
$ErrorActionPreference="Ignore"
# Delete symlinks in Pwsh 5.
Get-ChildItem $installPath -Recurse |? LinkType -eq 'SymbolicLink'|%{$_.Delete()}
# Delete the rest.
Remove-Item $installPath -Recurse -Force -ErrorAction Ignore
Remove-Item $installPath -Recurse -Force -ErrorAction Ignore
if (Test-Path $installPath) {
# Files are in use so delete failed.
# Rename used files and directories.
Get-ChildItem $installPath -Recurse -Exclude "*.deleteMe" | Sort-Object -Descending {(++$script:i)} | % { Rename-Item -Path $_.FullName -NewName ($_.Name + ".deleteMe") ; } *> $NULL
# Mark remaining for delete after restart.
Get-ChildItem $installPath -Recurse | % { MarkFileDelete ( $_.FullName) }
MarkFileDelete ( $installPath );
}
$ErrorActionPreference = 'Continue'
From: https://opensource.org/licenses/MIT
LICENSE
Copyright 2019 Gerardo Grignoli
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
function Uninstall-ChocolateyPath {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required when `-PathType 'Machine'.`
This puts a directory to the PATH environment variable.
.DESCRIPTION
Looks at both PATH environment variables to ensure a path variable
does not show up on the right PATH.
.NOTES
This command will assert UAC/Admin privileges on the machine if
`-PathType 'Machine'`.
This is used when the application/tool is not being linked by Chocolatey
(not in the lib folder).
.INPUTS
None
.OUTPUTS
None
.PARAMETER PathToUninstall
The full path to a location to remove / ensure is not in the PATH.
.PARAMETER PathType
Which PATH to remove from it. If specifying `Machine`, this requires admin
privileges to run correctly.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Uninstall-ChocolateyPath -PathToUninstall "$($env:SystemDrive)\tools\gittfs"
.EXAMPLE
Uninstall-ChocolateyPath "$($env:SystemDrive)\Program Files\MySQL\MySQL Server 5.5\bin" -PathType 'Machine'
.LINK
Install-ChocolateyPath
.LINK
Install-ChocolateyEnvironmentVariable
.LINK
Uninstall-ChocolateyEnvironmentVariable
.LINK
Get-EnvironmentVariable
.LINK
Set-EnvironmentVariable
.LINK
Get-ToolsLocation
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $pathToUninstall,
[parameter(Mandatory=$false, Position=1)][System.EnvironmentVariableTarget] $pathType = [System.EnvironmentVariableTarget]::User,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
## Called from chocolateysetup.psm1 - wrap any Write-Host in try/catch
$originalPathToUninstall = $pathToUninstall
$statementTerminator = ";"
# if the last digit is ;, then we are removing it
if ($pathToUninstall.EndsWith($statementTerminator)) {
$pathToUninstall = $pathToUninstall.Substring(0, $pathToUninstall.LastIndexOf($statementTerminator))
}
#get the PATH variable
Update-SessionEnvironment
$envPath = $env:PATH
if ($envPath.ToLower().Contains($pathToUninstall.ToLower()))
{
try {
Write-Host "PATH environment variable has $pathToUninstall in it. Removing..."
} catch {
Write-Verbose "PATH environment variable has $pathToUninstall in it. Removing..."
}
$actualPath = Get-EnvironmentVariable -Name 'Path' -Scope $pathType -PreserveVariables
$actualPath = $actualPath.Replace($pathToUninstall, "")
while ($actualPath.Contains($statementTerminator + $statementTerminator)) {
$actualPath = $actualPath.Replace($statementTerminator + $statementTerminator, $statementTerminator)
}
if ($pathType -eq [System.EnvironmentVariableTarget]::Machine) {
if (Test-ProcessAdminRights) {
Set-EnvironmentVariable -Name 'Path' -Value $actualPath -Scope $pathType
} else {
$psArgs = "Uninstall-ChocolateyPath -pathToUninstall `'$originalPathToUninstall`' -pathType `'$pathType`'"
Start-ChocolateyProcessAsAdmin "$psArgs"
}
} else {
Set-EnvironmentVariable -Name 'Path' -Value $actualPath -Scope $pathType
}
#removing it from the local path as well
$envPSPath = $env:PATH
$envPSPath = $envPSPath.Replace($pathToUninstall, "")
while($envPSPath.Contains($statementTerminator + $statementTerminator)) {
$envPSPath = $envPSPath.Replace($statementTerminator + $statementTerminator, $statementTerminator)
}
$env:Path = $envPSPath
}
}
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.
1. The embedded files are also available as a release in GitHub.
Please go to releases page
https://github.com/gerardog/gsudo/releases
Download same version as this choco package (example for v0.4)
https://github.com/gerardog/gsudo/releases/tag/v0.4
unzip and get hashes
powershell -command Get-FileHash *
2. Get hashes from this choco package. Run:
powershell -command Get-FileHash bin\*
3. The checksums should match the following:
---
Version Hashes for v1.2.1-alpha11
Algorithm Hash Path
--------- ---- ----
SHA256 30FB06A29969B2CEC53FBA7D4BEBE0F58CA887CD30F11AE1B2FD1B4F9988AB66 C:\git\gsudo\build\Chocolatey\gsudo\bin\gsudo.exe
SHA256 E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855 C:\git\gsudo\build\Chocolatey\gsudo\bin\gsudo.exe.ignore
SHA256 AAC4F3BA327A6D9E8169445932A6A800998C5250E335D515A2D4E9B6F617D966 C:\git\gsudo\build\Chocolatey\gsudo\bin\gsudoModule.psd1
SHA256 8F560141ED44DCB63C5B7FEF6DC5234F9E6BA9C69007FD2A85EB7E183619F6D6 C:\git\gsudo\build\Chocolatey\gsudo\bin\gsudoModule.psm1
SHA256 9AF22CB40B5EA60659BC3435507C0E3610BCCFA6EF8D7CC639232E8423D2229D C:\git\gsudo\build\Chocolatey\gsudo\bin\Invoke-gsudo.ps1
SHA256 E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855 C:\git\gsudo\build\Chocolatey\gsudo\bin\sudo.exe.ignore
Log in or click on link to see number of positives.
- gsudo.1.2.1-alpha11.nupkg (24f4a28eac2f) - ## / 59
- gsudo.exe (30fb06a29969) - ## / 68
In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).
Chocolatey Pro provides runtime protection from possible malware.
Add to Builder | Version | Downloads | Last Updated | Status |
---|---|---|---|---|
gsudo - a sudo for windows 2.5.1 | 53181 | Thursday, May 30, 2024 | Approved | |
gsudo - a sudo for windows 2.5.0 | 2611 | Tuesday, May 28, 2024 | Approved | |
gsudo - a sudo for windows 2.4.4 | 32528 | Tuesday, February 20, 2024 | Approved | |
gsudo - a sudo for windows 2.4.3 | 70 | Tuesday, February 20, 2024 | Approved | |
gsudo - a sudo for windows 2.4.2 | 21529 | Monday, December 18, 2023 | Approved | |
gsudo - a sudo for windows 2.4.1-fixnoninteractive | 176 | Sunday, October 1, 2023 | Approved | |
gsudo - a sudo for windows 2.4.0 | 33654 | Sunday, August 27, 2023 | Approved | |
gsudo - a sudo for windows 2.3.1-beta | 156 | Tuesday, August 22, 2023 | Approved | |
gsudo - a sudo for windows 2.3.0 | 19935 | Monday, July 17, 2023 | Approved | |
gsudo - a sudo for windows 2.2.0 | 1139 | Monday, July 17, 2023 | Approved | |
gsudo - a sudo for windows 2.1.0 | 5250 | Sunday, July 9, 2023 | Approved | |
gsudo - a sudo for windows 2.0.10 | 16540 | Sunday, June 4, 2023 | Approved | |
gsudo - a sudo for windows 2.0.9 | 12184 | Tuesday, May 2, 2023 | Approved | |
gsudo - a sudo for windows 2.0.8 | 2042 | Sunday, April 30, 2023 | Approved | |
gsudo - a sudo for windows 2.0.7 | 1374 | Friday, April 28, 2023 | Approved | |
gsudo - a sudo for windows 2.0.6 | 16139 | Friday, March 24, 2023 | Approved | |
gsudo - a sudo for windows 2.0.4 | 39158 | Monday, November 21, 2022 | Approved | |
gsudo - a sudo for windows 2.0.3 | 1940 | Friday, November 18, 2022 | Approved | |
gsudo - a sudo for windows 2.0.2 | 4872 | Thursday, November 10, 2022 | Approved | |
gsudo - a sudo for windows 2.0.1 | 1645 | Tuesday, November 8, 2022 | Approved | |
gsudo - a sudo for windows 2.0.0 | 2118 | Sunday, November 6, 2022 | Approved | |
gsudo - a sudo for windows 2.0.0-preview | 203 | Sunday, October 23, 2022 | Approved | |
gsudo - a sudo for windows 1.7.1 | 9307 | Sunday, October 16, 2022 | Approved | |
gsudo - a sudo for windows 1.7.0 | 7705 | Wednesday, September 28, 2022 | Approved | |
gsudo - a sudo for windows 1.6.0 | 4464 | Wednesday, September 21, 2022 | Approved | |
gsudo - a sudo for windows 1.5.1 | 5665 | Friday, September 9, 2022 | Approved | |
gsudo - a sudo for windows 1.4.1 | 2183 | Tuesday, September 6, 2022 | Approved | |
gsudo - a sudo for windows 1.4.0 | 1722 | Sunday, September 4, 2022 | Approved | |
gsudo - a sudo for windows 1.3.0 | 36524 | Wednesday, April 13, 2022 | Approved | |
gsudo - a sudo for windows 1.2.1-alpha11 | 80 | Tuesday, April 12, 2022 | Approved | |
gsudo - a sudo for windows 1.2.1-alpha10 | 93 | Tuesday, April 12, 2022 | Approved | |
gsudo - a sudo for windows 1.2.0 | 6430 | Friday, March 25, 2022 | Approved | |
gsudo - a sudo for windows 1.1.1 | 5036 | Saturday, March 12, 2022 | Approved | |
gsudo - a sudo for windows 1.1.0 | 4601 | Sunday, February 27, 2022 | Approved | |
gsudo - a sudo for windows 1.0.2 | 37335 | Wednesday, August 18, 2021 | Approved | |
gsudo - a sudo for windows 1.0.1 | 4255 | Saturday, August 7, 2021 | Approved | |
gsudo - a sudo for windows 0.7.3 | 14999 | Sunday, December 20, 2020 | Approved | |
gsudo - a sudo for windows 0.7.2 | 6054 | Sunday, August 9, 2020 | Approved |
2019 Gerardo Grignoli
This package has no dependencies.
Ground Rules:
- This discussion is only about gsudo - a sudo for windows and the gsudo - a sudo for windows package. If you have feedback for Chocolatey, please contact the Google Group.
- This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
- The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
- Tell us what you love about the package or gsudo - a sudo for windows, or tell us what needs improvement.
- Share your experiences with the package, or extra configuration or gotchas that you've found.
- If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.