When you run csi.exe /? (with Visual Studio 2015 update 2 installed), you will get the following syntax
Microsoft (R) Visual C# Interactive Compiler version 1.2.
You can use Environment.GetCommandLineArgs()
for that.
Example for your example:
using System;
Console.WriteLine("Hello {0}!", Environment.GetCommandLineArgs()[2]);
Notice that I'm reading the third item, because Environment.GetCommandLineArgs()
gives the entire command line (if you run the script using csi test.csx David
, the first one will be csi
and the second one test.csx
)