Skip to content

Instantly share code, notes, and snippets.

@seesharper
Last active June 3, 2018 21:21
Show Gist options
  • Save seesharper/4d09a287ff3301742124d7f38f249cc0 to your computer and use it in GitHub Desktop.
Save seesharper/4d09a287ff3301742124d7f38f249cc0 to your computer and use it in GitHub Desktop.
Global script docs take 1

Installing scripts globally

Say now that we have written some sort of utility script that really rocks and we would like to make this script available on our system as a global command.

Let's call this script rock.csx

Console.WriteLine("Global scripts rocks!")

We can now make this awesome script available a global script simply by doing

dotnet script install rock.csx

Now from anywhere on our system we can simply do

rock

Output

Global scripts rocks!

Alternatively we can give our global script a custom name/alias.

dotnet script install rock.csx -n RockMe

Now the global script is identified by our custom name RockMe and can be executed as follows:

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