Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of QUOTATION MARK characters appears to have changed in 7.3.0 #18540

Closed
5 tasks done
Liturgist opened this issue Nov 11, 2022 · 7 comments
Closed
5 tasks done
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-Answered The question is answered.

Comments

@Liturgist
Copy link

Liturgist commented Nov 11, 2022

Prerequisites

Steps to reproduce

The following statement was working under 7.2.

& svn.exe co "https://svnrepo.myco.com/db/trunk/$_`"`

GRAVE ACCENT characters not showing up correctly. Sorry for the picture.

image

After installing 7.3.0, it produces:

svn: E170000: Illegal repository URL '%22https://svnrepo.myco.com/db/trunk/Scripts%22

Expected behavior

Working copy is checked out.

Actual behavior

Working copy is not checked out.

Error details

No response

Environment data

PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@Liturgist Liturgist added the Needs-Triage The issue is new and needs to be triaged by a work group. label Nov 11, 2022
@pinkfloydx33
Copy link

Have noticed this as well; it broke some of our CI scripts that call out to all sorts of executables. Have also experienced slightly different behaviors between windows and Linux depending on the target application (for example ef migration bundles) and sometimes different if I splat arguments.

So far only when invoking applications and not with commandlets

I intend on opening issues in a few repos that offer argument completer scripts (Flux, helm, kustomize) as their powershell variants are all broken since 7.3 (with a simple fix)... Will link here once I do.

I checked release notes and didn't see mention of this behavior.

@mklement0
Copy link
Contributor

mklement0 commented Nov 12, 2022

v7.3 introduced a breaking change with respect to the - previously fundamentally broken - handling of (embedded) " chars. in arguments passed to external programs.

To make the previous workarounds that build on the broken behavior work, you must (temporarily) set $PSNativeCommandArgumentPassing to 'Legacy'.

For a summary of the consequences of the breaking change, see this comment.

@iSazonov iSazonov added Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered. labels Nov 12, 2022
@ghost
Copy link

ghost commented Nov 13, 2022

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Nov 13, 2022
@mklement0

This comment was marked as resolved.

@Liturgist
Copy link
Author

@mklement0, is it possible to write a script that will run unchanged on 7.3+ and 7.2- without embedding $PSNativeCommandArgumentPassing`? Is that the only way?

Trying to install 7.2.7 fails because. "A newer version of PowerShell is already installed" How can I install the earlier version in order to test?

@mklement0
Copy link
Contributor

@Liturgist, unfortunately, I don't think that's possible: if you want existing code to run without (other) modifications on both 7.2- / Windows PowerShell and 7.3+, you'll need to deal with $PSNativeCommandArgumentPassing.

Going forward and/or if modifying old code is possible, for cross-edition / cross-version code you could consider using the ie function from my Native module (Install-Module Native), which works in both editions and all PS Core versions, irrespective of the effective value of $PSNativeCommandArgumentPassing.
Additionally, it incorporates the proposed-in-vain accommodations for batch files and other high-profile CLIs, so that no workarounds are needed in most cases: just prepend ie to your external-program calls.

@mklement0
Copy link
Contributor

@Liturgist, as for installing an older version alongside the most recent one: I haven't personally tried, but it looks like installing via a specific version's .zip package may do the trick.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-Answered The question is answered.
Projects
None yet
Development

No branches or pull requests

4 participants