Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pass arguments to scripts

Dave McKeown edited this page May 22, 2014 · 2 revisions

If you need to handle command line arguments in your scripts you can do that by adding them after double dash:

scriptcs myscript.csx -- arg1 arg2

Then use them in your script with the string array Env.ScriptArgs

Console.Write(Env.ScriptArgs[0]); // writes arg1

Clone this wiki locally