Notes
Aliases in PowerShell
Setting aliases in my PowerShell profile, wrapping commands that take parameters in a function first since Set-Alias can’t take them directly.
System Administration
1# code $PROFILE.CurrentUserAllHosts
2code $PROFILE
1# Aliases for directories
2Function goToProjects { Set-Location -Path G:\Projects }
3
4Set-Alias -Name proj -Value goToProjects
- The profile for the current user is at
$PROFILE, but there are other ones for various hosts and all users as well - You can set aliases for commands, but you can not set aliases for commands that also take parameters. The workaround is to save the command with parameters as a function and then have an alias for that function instead of the command