Skip to content

PowerShell.md


PowerShell Alias

  • Open the profile using code $PROFILE.
  • Create a new function.
# Functions
function myfunc {
    Set-Location -Path "C:\add\path\here"
}
  • Create a new alias and set it for this function.
# Aliases
New-Alias cdr cd_into_rosetta

Note:

  • Aliases created by using New-Alias are not saved after you exit the session or close PowerShell.
  • Either use Export-Alias cmdlet to save alias information or use Set-Alias.

References: