Create a Permanent Powershell Alias from the Command-Line Dec 31, 2023 First, open your Powershell profile in your editor: code $PROFILE # Or use micro / vim / notepad / etc. Next, add the following function and alias: function _alias { Add-Content -Path $PROFILE -Value "" Add-Content -Path $PROFILE -Value "function _$($args[0]) {$($args[1])}" Add-Content -Path $PROFILE -Value "Set-Alias -Name $($args[0]) -Value _$($args[0])" } Set-Alias -Name alias -Value _alias Run . $PROFILE (remember the dot) to reload your profile. Now simply add new aliases with: alias alias-name 'command(s)-to-run "$args"' && . $PROFILE # to load the new alias # $args is optional but will pass anything after the alias through to the command. # Note the use of single quotes. Examples: alias testing 'echo "1, 2, $args!"' && . $PROFILE # > testing 5 # Output: 1, 2, 5! alias gc-m 'git commit -m "$args"' && . $PROFILE # > gc-m "init" # Equal to: git commit -m "init" More info: Using Powershell Aliases in a Pipeline