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(
64
64
{
65
65
return new StackFrameDetails
66
66
{
67
- ScriptPath = callStackFrame . ScriptName ,
67
+ ScriptPath = callStackFrame . ScriptName ?? "<No File>" ,
68
68
FunctionName = callStackFrame . FunctionName ,
69
69
LineNumber = callStackFrame . Position . StartLineNumber ,
70
70
ColumnNumber = callStackFrame . Position . StartColumnNumber ,
Original file line number Diff line number Diff line change @@ -455,18 +455,22 @@ public async Task<IEnumerable<object>> ExecuteScriptString(
455
455
/// <returns>A Task that can be awaited for completion.</returns>
456
456
public async Task ExecuteScriptAtPath ( string scriptPath , string arguments = null )
457
457
{
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 ( ) ;
462
459
463
460
if ( arguments != null )
464
461
{
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 ;
467
467
468
- PSCommand command = new PSCommand ( ) ;
469
- command . AddScript ( escapedScriptPath ) ;
468
+ command . AddScript ( scriptWithArgs ) ;
469
+ }
470
+ else
471
+ {
472
+ command . AddCommand ( scriptPath ) ;
473
+ }
470
474
471
475
await this . ExecuteCommand < object > ( command , true ) ;
472
476
}
You can’t perform that action at this time.
0 commit comments