Skip to content

Commit 754cbe4

Browse files
committed
Made change as per suggestion
1 parent 1868073 commit 754cbe4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/Custom/PSCmdletExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace NamespacePrefixPlaceholder.PowerShell
1919
internal static class PSCmdletExtensions
2020
{
2121
private static readonly char[] PathSeparators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
22-
private static readonly Regex EnclosedStringRegex = new Regex(@"'.*?'| "".*?""", RegexOptions.Compiled, TimeSpan.FromSeconds(1));
2322

2423
// Converts a string to its unescaped form. The method also replaces '+' with spaces.
2524
internal static string UnescapeString(this PSCmdlet cmdlet, string value)
@@ -30,7 +29,7 @@ internal static string UnescapeString(this PSCmdlet cmdlet, string value)
3029
try
3130
{
3231
var unescapedString = Uri.UnescapeDataString(value);
33-
return EnclosedStringRegex.IsMatch(value) ? unescapedString: unescapedString.Replace('+', ' ');
32+
return value.EndsWith("'") ? unescapedString: unescapedString.Replace('+', ' ');
3433
}
3534
catch (UriFormatException ex)
3635
{

0 commit comments

Comments
 (0)