Skip to content

Instantly share code, notes, and snippets.

@Dobby89
Last active October 26, 2018 07:46
Show Gist options
  • Save Dobby89/4279253e7d437e8e21ca6c39ec96ad9b to your computer and use it in GitHub Desktop.
Save Dobby89/4279253e7d437e8e21ca6c39ec96ad9b to your computer and use it in GitHub Desktop.
Set alias commands in powershell

Full docs

1) Open Powershell in administrator

2a) Make sure you have a profile created (where you can save your aliases)

PS> New-Item -Type file -Force $profile

2b) Check where the profile has been created

PS> $profile`

C:\Users\username\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

3) Add the alias command/function to the profile file: Microsoft.PowerShell_profile.ps1

function cd_docs {set-location c:\Users\username\Documents}
Set-Alias docs cd_docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment