Last active
January 25, 2025 14:38
-
-
Save lfalck/fbb04ef438b521064e0c5742bcd28c2f to your computer and use it in GitHub Desktop.
Remove the PowerShell alias curl -> Invoke-WebRequest
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
# This script will add the Remove-Item alias:curl command to an existing PowerShell profile or create one if it does not exist | |
# If it is run from PowerShell ISE an ISE profile will be created: Microsoft.PowerShellISE_profile.ps1 | |
# Otherwise a regular profile will be created: Microsoft.PowerShell_profile.ps1 | |
$removeCurlAlias = @" | |
# Remove Alias curl -> Invoke-WebRequest | |
Remove-Item alias:curl | |
"@ | |
if (-Not (Test-Path $Profile)) | |
{ | |
New-Item –Path $Profile –Type File -Value "$removeCurlAlias`r`n" | |
} | |
else | |
{ | |
Add-Content –Path $Profile -Value "`r`n$removeCurlAlias" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment