Public/unalias.ps1
function unalias([string]$Alias,[switch]$Force){ if( (Get-Alias $Alias).Description -eq "A UNIX-style alias using functions" ) { Remove-Item "function:Alias$Alias" -Force:$Force Remove-Item "alias:$alias" -Force:$Force if($?) { "Removed alias '$Alias' and accompanying function" } } else { Remove-Item "alias:$alias" -Force:$Force if($?) { "Removed alias '$Alias'" } } } |