// ... use fsi = FsiEvaluationSession.Create(fsiConfig, a fsi.EvalInteraction $"#load \"{path}\";;" let funcResult: FsiValue option = fsi.EvalExpressi let funcObj: obj = match funcResult with | Some funcValue -> funcValue.ReflectionValue | _ -> failwith "error" let resultObj: obj = funcObj.GetType().GetMethod(" match resultObj with | :? string as s -> s | _ -> failwith "error" 1 2 3 // script.fsx ( : ): let "hello, {s}!" s string string $ calc = (1) Init FSI (2) Load script (3) Grab the function (4) Invoke the function