File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
src/PowerShellEditorServices Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ static internal StackFrameDetails Create(
6464 {
6565 return new StackFrameDetails
6666 {
67- ScriptPath = callStackFrame . ScriptName ,
67+ ScriptPath = callStackFrame . ScriptName ?? "<No File>" ,
6868 FunctionName = callStackFrame . FunctionName ,
6969 LineNumber = callStackFrame . Position . StartLineNumber ,
7070 ColumnNumber = callStackFrame . Position . StartColumnNumber ,
Original file line number Diff line number Diff line change @@ -455,18 +455,22 @@ public async Task<IEnumerable<object>> ExecuteScriptString(
455455 /// <returns>A Task that can be awaited for completion.</returns>
456456 public async Task ExecuteScriptAtPath ( string scriptPath , string arguments = null )
457457 {
458- // If we don't escape wildcard characters in the script path, the script can
459- // fail to execute if say the script name was foo][.ps1.
460- // Related to issue #123.
461- string escapedScriptPath = EscapePath ( scriptPath , escapeSpaces : true ) ;
458+ PSCommand command = new PSCommand ( ) ;
462459
463460 if ( arguments != null )
464461 {
465- escapedScriptPath += " " + arguments ;
466- }
462+ // If we don't escape wildcard characters in the script path, the script can
463+ // fail to execute if say the script name was foo][.ps1.
464+ // Related to issue #123.
465+ string escapedScriptPath = EscapePath ( scriptPath , escapeSpaces : true ) ;
466+ string scriptWithArgs = escapedScriptPath + " " + arguments ;
467467
468- PSCommand command = new PSCommand ( ) ;
469- command . AddScript ( escapedScriptPath ) ;
468+ command . AddScript ( scriptWithArgs ) ;
469+ }
470+ else
471+ {
472+ command . AddCommand ( scriptPath ) ;
473+ }
470474
471475 await this . ExecuteCommand < object > ( command , true ) ;
472476 }
You can’t perform that action at this time.
0 commit comments