File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
src/PowerShellEditorServices Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -56,16 +56,6 @@ public DebugService(PowerShellContext powerShellContext)
56
56
57
57
#region Public Methods
58
58
59
- /// <summary>
60
- /// Returns the passed in path with the [ and ] wildcard characters escaped.
61
- /// </summary>
62
- /// <param name="path">The path to process.</param>
63
- /// <returns>The path with [ and ] escaped.</returns>
64
- public static string EscapeWilcardsInPath ( string path )
65
- {
66
- return path . Replace ( "[" , "`[" ) . Replace ( "]" , "`]" ) ;
67
- }
68
-
69
59
/// <summary>
70
60
/// Sets the list of breakpoints for the current debugging session.
71
61
/// </summary>
@@ -89,7 +79,7 @@ public async Task<BreakpointDetails[]> SetBreakpoints(
89
79
{
90
80
// Fix for issue #123 - file paths that contain wildcard chars [ and ] need to
91
81
// quoted and have those wildcard chars escaped.
92
- string escapedScriptPath = EscapeWilcardsInPath ( scriptFile . FilePath ) ;
82
+ string escapedScriptPath = PowerShellContext . EscapeWildcardsInPath ( scriptFile . FilePath ) ;
93
83
94
84
PSCommand psCommand = new PSCommand ( ) ;
95
85
psCommand . AddCommand ( "Set-PSBreakpoint" ) ;
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ public async Task ExecuteScriptAtPath(string scriptPath)
438
438
// If we don't escape wildcard characters in the script path, the script can
439
439
// fail to execute if say the script name was foo][.ps1.
440
440
// Related to issue #123.
441
- string escapedScriptPath = DebugService . EscapeWilcardsInPath ( scriptPath ) ;
441
+ string escapedScriptPath = EscapeWildcardsInPath ( scriptPath ) ;
442
442
443
443
PSCommand command = new PSCommand ( ) ;
444
444
command . AddCommand ( escapedScriptPath ) ;
@@ -552,6 +552,16 @@ internal void ReleaseRunspaceHandle(RunspaceHandle runspaceHandle)
552
552
}
553
553
}
554
554
555
+ /// <summary>
556
+ /// Returns the passed in path with the [ and ] wildcard characters escaped.
557
+ /// </summary>
558
+ /// <param name="path">The path to process.</param>
559
+ /// <returns>The path with [ and ] escaped.</returns>
560
+ internal static string EscapeWildcardsInPath ( string path )
561
+ {
562
+ return path . Replace ( "[" , "`[" ) . Replace ( "]" , "`]" ) ;
563
+ }
564
+
555
565
#endregion
556
566
557
567
#region Events
You can’t perform that action at this time.
0 commit comments