Skip to content

Commit

Permalink
fix of PSScriptRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
steve02081504 committed Aug 10, 2024
1 parent 86f1ccf commit 2d1b01a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/programFrames/default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1943,18 +1943,20 @@ public PSRunner() {
this.PSRunSpace.SessionStateProxy.SetVariable("PSEXEscript", script);
}
}
/*
#if !Pwsh20
script = "function PSEXEMainFunction{"+script+"}";
#if Pwsh20
this.pwsh.AddScript(script);
#else
{
Token[] tokens;
ParseError[] errors;
ScriptBlockAst AST = Parser.ParseInput(script, exepath, out tokens, out errors);
this.PSRunSpace.SessionStateProxy.SetVariable("PSEXEIniter", AST.GetScriptBlock());
if(errors.Length > 0)
throw new System.InvalidProgramException(errors[0].Message);
this.pwsh.AddScript(".$PSEXEIniter");
}
#endif
*/
this.pwsh.AddScript("function PSEXEMainFunction{"+script+"}");
}
~PSRunner() {
this.pwsh.Dispose();
Expand Down

0 comments on commit 2d1b01a

Please sign in to comment.