parent
63d79a4305
commit
425af13026
|
@ -43,8 +43,8 @@ function global:prompt {
|
||||||
# Build an arguments string which follows the C++ command-line argument quoting rules
|
# Build an arguments string which follows the C++ command-line argument quoting rules
|
||||||
# See: https://docs.microsoft.com/en-us/previous-versions//17w5ykft(v=vs.85)?redirectedfrom=MSDN
|
# See: https://docs.microsoft.com/en-us/previous-versions//17w5ykft(v=vs.85)?redirectedfrom=MSDN
|
||||||
$escaped = $Arguments | ForEach-Object {
|
$escaped = $Arguments | ForEach-Object {
|
||||||
$s = $_ -Replace '(\\+)"','$1$1"'; # Escape backslash chains immediately preceeding quote marks.
|
$s = $_ -Replace '(\\+)"','$1$1"'; # Escape backslash chains immediately preceding quote marks.
|
||||||
$s = $s -Replace '(\\+)$','$1$1'; # Escape backslash chains immediately preceeding the end of the string.
|
$s = $s -Replace '(\\+)$','$1$1'; # Escape backslash chains immediately preceding the end of the string.
|
||||||
$s = $s -Replace '"','\"'; # Escape quote marks.
|
$s = $s -Replace '"','\"'; # Escape quote marks.
|
||||||
"`"$s`"" # Quote the argument.
|
"`"$s`"" # Quote the argument.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue