Search code examples
scriptcs

Can I access ScriptArgs from a Script Pack?


For ScriptCs scripts I'd like to write a Script Pack that is using command line arguments.

scriptcs myscript.csx -- some args

Within a script I use ScriptArgs, but is it also available somehow from within a Script Pack?


Solution

  • Yes, the IScriptPackSession interface which is passed to your script pack on initialization now has a property called ScriptArgs :) See the source.