GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — PowerShell 7.3 sends arguments to native apps differently · Issue #18617 · PowerShell/PowerShell

PowerShell 7.3 sends arguments to native apps differently #18617

New issue
Copy link
New issue
Copy link
Closed
Closed
PowerShell 7.3 sends arguments to native apps differently#18617
Copy link

Description

@nightroman
Roman Kuzmin 1967-2026 (nightroman)
opened on Nov 18, 2022
Issue body actions

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

Please use the attached script test.ps1 and satellite trivial Get-Arg.exe that prints all the arguments.

_221118_1846-ps730.zip

Or use/build from sources below:

test.ps1

& $PSScriptRoot\Get-Arg.exe 1 'a a' '"b"' '\"c\"'

Get-Arg.cs

using System;

internal class Program
{
    static void Main(string[] args)
    {
        foreach (var arg in args)
            Console.WriteLine(arg);
    }
}

Test 1 Invoke by powershell 5.1:

powershell .\test.ps1

Output (good):

1
a a
b
"c"

Test 2 Invoke by pwsh 7.2.7:

C:\Bin\pwsh.7.2.7\pwsh.exe .\test.ps1

Output (good, the same as above):

1
a a
b
"c"

Test 3 Invoke by pwsh 7.3.0:

pwsh .\test.ps1

Output (not good, different from test 1 and 2):

1
a a
"b"
\"c\"

The third and forth arguments are sent differently.

Expected behavior

see above

Actual behavior

see above

Error details

.

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Microsoft Windows 10.0.19045
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

Activity

  1. Roman Kuzmin 1967-2026 (nightroman)
    added
    Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.
    on Nov 18, 2022
  2. nightroman commented on Nov 18, 2022

    @nightroman
    Roman Kuzmin 1967-2026 (nightroman)
    on Nov 18, 2022
    Author
    More actions

    The release notes do not mention this change -- https://github.com/PowerShell/PowerShell/releases/tag/v7.3.0

    So this might be a bug or unintended change. If this is the intended change then it's worth mentioning because it breaks the behavior existed for years.

    GitHub
    Release v7.3.0 Release of PowerShell · PowerShell/PowerShell
    7.3.0 - 2022-11-08 General Cmdlet Updates and Fixes

    Correct calling cmdlet New-PSSessionOption in script for Restart-Computer (#18374)

    Tests

    Add test for framework dependent package in release p...

  3. jhoneill commented on Nov 18, 2022

    @jhoneill
    James O'Neill (jhoneill)
    on Nov 18, 2022
    More actions

    See #18614
    #18568
    and #18554

  4. nightroman commented on Nov 19, 2022

    @nightroman
    Roman Kuzmin 1967-2026 (nightroman)
    on Nov 19, 2022
    Author
    More actions

    James O'Neill (@jhoneill) Thank you. The suggested $PSNativeCommandArgumentPassing = 'Legacy' works as a workaround.

    I agree that 7.3.0 works "better". But it clearly breaks things.
    The change should be well documented and visible in release notes.
    In the past, the PS team refused to fix some bugs for avoiding breaking effects like this.

    I'm closing as the duplicate of other issues.

    Reacted by robinmalik and w3lld0ne
  5. Roman Kuzmin 1967-2026 (nightroman)
    closed this as completedon Nov 19, 2022
  6. ghost removed
    Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.
    on Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.