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)
5656
5757 #region Public Methods
5858
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-
6959 /// <summary>
7060 /// Sets the list of breakpoints for the current debugging session.
7161 /// </summary>
@@ -89,7 +79,7 @@ public async Task<BreakpointDetails[]> SetBreakpoints(
8979 {
9080 // Fix for issue #123 - file paths that contain wildcard chars [ and ] need to
9181 // quoted and have those wildcard chars escaped.
92- string escapedScriptPath = EscapeWilcardsInPath ( scriptFile . FilePath ) ;
82+ string escapedScriptPath = PowerShellContext . EscapeWildcardsInPath ( scriptFile . FilePath ) ;
9383
9484 PSCommand psCommand = new PSCommand ( ) ;
9585 psCommand . AddCommand ( "Set-PSBreakpoint" ) ;
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ public async Task ExecuteScriptAtPath(string scriptPath)
438438 // If we don't escape wildcard characters in the script path, the script can
439439 // fail to execute if say the script name was foo][.ps1.
440440 // Related to issue #123.
441- string escapedScriptPath = DebugService . EscapeWilcardsInPath ( scriptPath ) ;
441+ string escapedScriptPath = EscapeWildcardsInPath ( scriptPath ) ;
442442
443443 PSCommand command = new PSCommand ( ) ;
444444 command . AddCommand ( escapedScriptPath ) ;
@@ -552,6 +552,16 @@ internal void ReleaseRunspaceHandle(RunspaceHandle runspaceHandle)
552552 }
553553 }
554554
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+
555565 #endregion
556566
557567 #region Events
You can’t perform that action at this time.
0 commit comments