Skip to content

Instantly share code, notes, and snippets.

@souhaiebtar
Last active June 10, 2021 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save souhaiebtar/c3f876a439ca9a2b4e536e9fa8ce303a to your computer and use it in GitHub Desktop.
Save souhaiebtar/c3f876a439ca9a2b4e536e9fa8ce303a to your computer and use it in GitHub Desktop.
[powershell aliases] powershell aliases #powershell #aliases
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