Last active
July 12, 2018 20:13
-
-
Save glachancecmaisonneuve/639732f0196ec6b2ef85506ce2ce82ed to your computer and use it in GitHub Desktop.
DoNotFuckWithMyPath overrides chocolatey's Install-ChocolateyPath function (installers may still change your paths, but package maintainers can't)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Register-DoNotFuckWithMyPath { | |
param( | |
[parameter(Mandatory=$true, Position=0)][string] $pathToInstall, | |
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments | |
) | |
Write-Host "Chocolatey-DoNotFuckWithMyPath Extension prevented an overzealous package manager to from fucking with your path." | |
Write-Host "(It attempted to add $pathToInstall)" | |
} | |
New-Alias -Name 'Install-ChocolateyPath' -Value 'Register-DoNotFuckWithMyPath' -Scope Global | |
Write-Host "Chocolatey-DoNotFuckWithMyPath Extension is enabled" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment