Skip to content

Instantly share code, notes, and snippets.

@mrgarymartin
Created October 17, 2023 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrgarymartin/d2c296bb6ac019d59009c38f745eec9e to your computer and use it in GitHub Desktop.
Save mrgarymartin/d2c296bb6ac019d59009c38f745eec9e to your computer and use it in GitHub Desktop.
Create a permanent Powershell Alias Profile

Make the document user profile

cd $env:USERPROFILE\Documents
md WindowsPowerShell -ErrorAction SilentlyContinue
New-Item -Path $Profile -Type File

Using a function the contents of Microsoft.PowerShell_profile.ps1 can be:

function Do-ActualThing {
    # do actual thing
}

Set-Alias MyAlias Do-ActualThing

Using just a simple alias:

Set-Alias MyAlias Action

example:

Set-Alias tf terraform

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment