Skip to content

Argument parser truncates closing parenthesis from string when running on windows in Powershell #27865

@sonofhammer

Description

@sonofhammer

Describe the bug

String parser deletes a closing parenthesis from the string.

I've seen this elsewhere, so I know this is not isolated only to variable creation, but I can repeatedly reproduce it while creating or updating a variable in a variable group.

To reproduce:

  1. using windows powershell 7.x
  2. create a variable group. get its id
  3. run az pipelines variable-group variable create --group-id <group id> --name "myvar" --org <org url> --project <project name> --value 'thisVarEndsInaParenthesis)'
  4. observe output
{
  "myvar": {
    "isSecret": null,
    "value": "thisVarEndsInaParenthsis"
  }
}

Notice the missing parenthesis at the end of the var value.
5. Navigate to var group in the browser and observe the same missing parenthesis there as well.

Related command

az pipelines variable-group variable create

Errors

none

Issue script & Debug output

az pipelines variable-group variable create --group-id --name "myvar" --org --project --secret false --value 'thisVarEndsInaParenthsis)' --debug
--debug was unexpected at this time.
C:> "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\..\python.exe" -IBm azure.cli pipelines variable-group variable create --group-id --name myvar --org --project --secret false --value thisVarEndsInaParenthsis) --debug

Expected behavior

Variable is created with its value having a parenthesis at the end.

Environment Summary

{
"azure-cli": "2.54.0",
"azure-cli-core": "2.54.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"azure-devops": "0.26.0",
"containerapp": "0.3.44"

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botDevOpsPipelinesService AttentionThis issue is responsible by Azure service team.act-platform-engineering-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions