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