.netazureroslynazure-webjobsscriptcs

How to run scriptcs without installation? Make portable/standalone scriptcs (csx)


Is it possible to make a portable scriptcs?

I want to write a script and fire it from console/bat file on another machine (with the same OS). I imagine this should look like:

SomeKindOfScriptCsExecutor.exe myscript.csx -param1 -param2

or

MyCompiledScriptAndExportedTo.exe -param1 -param2

Reason: I want to execute scriptcs from Azure WebJobs.


Solution

  • As far as I know, you don't need to install anything to use scriptcs.

    You can get it via Chocolatey, but you can also get it as a zip file. If you want to use that specific Chocolatey version, just change .nupkg to .zip and you will be able to extract the package.

    This allows to run it as:

    scriptcs.exe yourScript.xcs

    So it can be executed from .cmd or .bat file as:

    call scriptcs.exe yourScript.xcs

    Note that: