Marius Gheorghe

Building software : make it work, make it good, make it fast

Powershell aliases are worthless

Powershell aliases are mostly a waste of time. They have 2 big problems :
- you can't alias a command with multiple parameters. Basically you can't have

Set-Alias scxc "svn update c:\work\trunk"

Actually you can set that alias. But it fails when you run it. So as a workaround you'll have to use a function

function scxc()
   svn update c:\work\trunk

Which brings me to the second problem.
- aliases aren't persisted by default. You have to use Export-Alias and Import-Alias between sessions. And here's the kicker : aliases with functions can't be exported and imported correctly.

A much better solution is to skip aliases and add all this stuff directly to your powershell profile (by default you can find it in %userprofile%/MyDocuments/WindowsPowerShell/Microsoft.PowerShell_profile.ps1).
Just edit it and add functions there that act as aliases.