-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
\C
characters sequence in the field after the separator causes an error:
$ 'aaa=aaa\Ccc' | ConvertFrom-StringData
ConvertFrom-StringData: Invalid pattern 'aaa\Ccc' at offset 5. Unrecognized escape sequence \C.
Expected behavior
Data field after the first delimiter should be the literal. Without escapes:
$ 'aaa=aaa\\Ccc' | ConvertFrom-StringData
Name Value
---- -----
aaa aaa\Ccc
Actual behavior
Data field causes the parse error
Error details
$ (Get-Error).Exception
Type : System.Text.RegularExpressions.RegexParseException
Error : UnrecognizedEscape
Offset : 5
Message : Invalid pattern 'aaa\Ccc' at offset 5. Unrecognized escape sequence \C.
ParamName :
TargetSite : Char ScanCharEscape()
Data : {}
InnerException :
HelpLink :
Source : System.Text.RegularExpressions
HResult : -2147024809
StackTrace : at System.Text.RegularExpressions.RegexParser.ScanCharEscape()
at System.Text.RegularExpressions.RegexParser.UnescapeImpl(String input, Int32 i)
at Microsoft.PowerShell.Commands.ConvertFromStringDataCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
Environment data
Name Value
---- -----
PSVersion 7.4.0-preview.6
PSEdition Core
GitCommitId 7.4.0-preview.6
OS ArcoLinux
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
Metadata
Metadata
Assignees
Labels
No labels