Skip to content

Instantly share code, notes, and snippets.

@slikts
Created November 14, 2019 17:53
Show Gist options
  • Save slikts/3f677287335589015cb8140f208b7c6d to your computer and use it in GitHub Desktop.
Save slikts/3f677287335589015cb8140f208b7c6d to your computer and use it in GitHub Desktop.
Windows aliases with parameters

Replicating bash functions in Windows

Using Win+R to run a command with parameters, similar to bash functions.

mkdir %userprofile%\bin

Add %userprofile%\bin to PATH.

Create %userprofile%\bin\ci.ps1 with a line like this (edited for your needs):

code-insiders --remote ssh-remote+vb /home/slikts/work/$args

Create a shortcut in the same location with this target:

powershell.exe -ExecutionPolicy Bypass -File ci.ps1

-NoExit can be added to the arguments for debugging.

Now the Windows Run dialog (opened with Win+R) can be used to quickly start the code-insiders process in a specific sub-directory by entering ci example.

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