3 ms·
Never used powershell, is it really that hard to create an alias in powershell? http://stackoverflow.com/questions/24914589/how-to-create-permanent-powershell
by MichaelMoser123 10y ago
Never used powershell, is it really that hard to create an alias in powershell? http://stackoverflow.com/questions/24914589/how-to-create-permanent-powershell-aliases http://stackoverflow.com/questions/24914589/how-to-create-pe...
- ygra 10y agoAliases in PowerShell only alias the command itself and can not supply any parameters or other processing. This makes certain things nice, in that Get-Help works straightforward with aliases, and tab completion for arguments as well, but it complicates the case where you want to supply default arguments or do other things. You can run Get-Content Function:help to see how it can be done. Essentially it consists of: - Writing a function - Redirecting to the correct help topic - Replicating all parameters and parameter sets so that tab completion works Of course, if help and completion are irrelevant to you (wouldn't work correctly out of the box for bash either, I guess), then it just consists of writing a wrapper function instead of setting an alias.
- nailer 10y agoLike bash (where aliases are also limited) most people list make functions.