allenap / shell-quote

A Rust library for shell quoting strings, e.g. for interpolating into a Bash script. This is not as simple as most people think!
Apache License 2.0
5 stars 2 forks source link

Add support for PowerShell #32

Open Jisu-Woniu opened 1 month ago

Jisu-Woniu commented 1 month ago

Is it possible to add support for PowerShell string escaping?

Example usage:

assert_eq!(Pwsh::quote_vec("foo bar"), b"'foo bar'");
assert_eq!(Pwsh::quote_vec("foo\nbar"), b"\"foo`nbar\"");
Jisu-Woniu commented 1 month ago

Reference:

https://learn.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-02?view=powershell-7.4#2352-string-literals