Last active
June 10, 2021 08:37
-
-
Save souhaiebtar/c3f876a439ca9a2b4e536e9fa8ce303a to your computer and use it in GitHub Desktop.
[powershell aliases] powershell aliases #powershell #aliases
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
if (Test-Path Alias:rm) {Remove-Item Alias:rm} | |
# custom function for 'rm' | |
function rm { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory = $false)] | |
[switch]$rf, | |
[Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
[string]$Path | |
) | |
Process { | |
Remove-Item -Path $Path -Recurse:$rf -Force:$rf | |
} | |
} | |
#https://stackoverflow.com/questions/53096058/in-powershell-is-it-possible-to-create-an-alias-whose-name-has-a-space-in-it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment