Skip to content

[Core] Prefer PowerShell launcher on Windows to preserve multiline CLI arguments#33595

Draft
Copilot wants to merge 6 commits into
devfrom
copilot/fix-az-cmd-truncate-arguments
Draft

[Core] Prefer PowerShell launcher on Windows to preserve multiline CLI arguments#33595
Copilot wants to merge 6 commits into
devfrom
copilot/fix-az-cmd-truncate-arguments

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Related command
`az repos pr create --description "First paragraph

Second paragraph"`

Description
Windows az.cmd forwarding (%*) drops content after embedded newlines. This PR makes packaged Windows installs expose and exercise a PowerShell launcher path (az.ps1) so multiline arguments are preserved when invoked from PowerShell.

  • Launcher packaging updates
    • build_scripts/windows/scripts/build.cmd now packages az.ps1 into MSI layout:
      • wbin\az.ps1 (from build_scripts/windows/scripts/az.ps1)
    • build_scripts/windows/scripts/build.cmd now packages az.ps1 into ZIP layout:
      • bin\az.ps1 (from build_scripts/windows/scripts/az_zip.ps1)
  • Launcher script updates
    • Added dedicated lightweight launcher sources:
      • build_scripts/windows/scripts/az.ps1 (AZ_INSTALLER="MSI")
      • build_scripts/windows/scripts/az_zip.ps1 (AZ_INSTALLER="ZIP")
    • Added inline note in both scripts clarifying expected relative python.exe location.
  • Install validation path updates
    • build_scripts/windows/scripts/test_msi_installation.ps1 now invokes ...\wbin\az.ps1
    • build_scripts/windows/scripts/test_zip_installation.ps1 now invokes ...\bin\az.ps1
  • Resulting behavior
    • PowerShell invocation path no longer depends on az.cmd argument forwarding for install validation and packaged launcher availability.
    • AZ_INSTALLER is preserved correctly per package type for the PowerShell launcher path (MSI vs ZIP).
copy %REPO_ROOT%\build_scripts\windows\scripts\az.ps1 %BUILDING_DIR%\wbin\az.ps1
copy %REPO_ROOT%\build_scripts\windows\scripts\az_zip.ps1 %BUILDING_DIR%\bin\az.ps1

Testing Guide
Use a multiline argument from PowerShell against the packaged launcher path (MSI wbin\az.ps1 or ZIP bin\az.ps1), e.g. --description with embedded newlines, and confirm full value reaches CLI parsing.
Also verify installer marker behavior through the PowerShell launchers:

  • MSI path sets AZ_INSTALLER=MSI
  • ZIP path sets AZ_INSTALLER=ZIP

History Notes
[Core] az: Package dedicated az.ps1 launchers for Windows MSI/ZIP layouts and use az.ps1 in install validation to avoid multiline argument truncation via az.cmd in PowerShell.


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 22, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.14
️✔️acs
️✔️latest
️✔️3.12
️✔️3.14
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.14
️✔️ams
️✔️latest
️✔️3.12
️✔️3.14
️✔️apim
️✔️latest
️✔️3.12
️✔️3.14
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.14
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️aro
️✔️latest
️✔️3.12
️✔️3.14
️✔️backup
️✔️latest
️✔️3.12
️✔️3.14
️✔️batch
️✔️latest
️✔️3.12
️✔️3.14
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.14
️✔️billing
️✔️latest
️✔️3.12
️✔️3.14
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.14
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.14
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.14
️✔️config
️✔️latest
️✔️3.12
️✔️3.14
️✔️configure
️✔️latest
️✔️3.12
️✔️3.14
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.14
️✔️container
️✔️latest
️✔️3.12
️✔️3.14
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.14
️✔️core
️✔️latest
️✔️3.12
️✔️3.14
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.14
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.14
️✔️dls
️✔️latest
️✔️3.12
️✔️3.14
️✔️dms
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.14
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.14
️✔️find
️✔️latest
️✔️3.12
️✔️3.14
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.14
️✔️identity
️✔️latest
️✔️3.12
️✔️3.14
️✔️iot
️✔️latest
️✔️3.12
️✔️3.14
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.14
️✔️lab
️✔️latest
️✔️3.12
️✔️3.14
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️maps
️✔️latest
️✔️3.12
️✔️3.14
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.14
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.14
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.14
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.14
️✔️network
️✔️latest
️✔️3.12
️✔️3.14
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.14
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.14
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.14
️✔️profile
️✔️latest
️✔️3.12
️✔️3.14
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.14
️✔️redis
️✔️latest
️✔️3.12
️✔️3.14
️✔️relay
️✔️latest
️✔️3.12
️✔️3.14
️✔️resource
️✔️latest
️✔️3.12
️✔️3.14
️✔️role
️✔️latest
️✔️3.12
️✔️3.14
️✔️search
️✔️latest
️✔️3.12
️✔️3.14
️✔️security
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.14
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.14
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.14
️✔️sql
️✔️latest
️✔️3.12
️✔️3.14
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.14
️✔️storage
️✔️latest
️✔️3.12
️✔️3.14
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.14
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.14
️✔️util
️✔️latest
️✔️3.12
️✔️3.14
️✔️vm
️✔️latest
️✔️3.12
️✔️3.14

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @copilot,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 22, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

Copilot AI changed the title [WIP] Fix az.cmd truncation of multi-line arguments on Windows [Core] Prefer PowerShell launcher on Windows to preserve multiline CLI arguments Jun 22, 2026
Copilot AI requested a review from a0x1ab June 22, 2026 01:18
@azclibot

Copy link
Copy Markdown
Collaborator

Live test results — azdev test --live --series

FAIL (exit )

Target: `` ()
PR head ref: copilot/fix-az-cmd-truncate-arguments
PR head sha: `4276eef7ffdf775e3e0ee98be4320d50281fdfc7`
PR base ref: `dev`
New test files in PR:

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/27923808753

Last 80 lines of azdev output
(no log captured)

Posted by agent-assist live-test workflow.

@yonzhan

yonzhan commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Core

@azclibot azclibot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CI and Live-Test Review

@copilot, the automated checks for this PR have completed with failures. Please investigate and address the following issues.

CI Check Failures (3 failed / 91 passed)

Check Result Link
Azure.azure-cli (build) ❌ failure Build #20260622.3 failed
Azure.azure-cli (Credential Scanner) ❌ failure Credential Scanner failed
Azure.azure-cli (Codegen Coverage) ❌ failure Codegen Coverage failed

Live Test Result

Workflow Result Link
Live integration test ❌ failure Run #27923808753

Next Steps

  1. Review the build failure log to identify compilation or packaging errors.
  2. Investigate the Credential Scanner failure — ensure no secrets or credentials were accidentally included.
  3. Check the Codegen Coverage failure — verify the code generation coverage meets required thresholds.
  4. Review the live test failure for runtime errors against the actual Azure service.

Once the issues are resolved and a new commit is pushed, the checks will be re-evaluated.


Posted by agent-assist (autonomous bug-fix pipeline).

@a0x1ab

a0x1ab commented Jun 22, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33595 (review) and push a fix.


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33595 (review) and pu...

Addressed and pushed fixes in a0f892b (plus follow-up commits ce0f7e4, 3ed9d51). I switched packaging to use dedicated lightweight PowerShell launchers for az.ps1, set AZ_INSTALLER correctly for MSI vs ZIP, and kept install validation on az.ps1. I also re-ran automated review/security validation and it is now clean.

@azclibot

Copy link
Copy Markdown
Collaborator

Live test results — azdev test --live --series

FAIL (exit )

Target: `` ()
PR head ref: copilot/fix-az-cmd-truncate-arguments
PR head sha: `3ed9d51f23db9087902fb8c9a4802f82790e3c6e`
PR base ref: `dev`
New test files in PR:

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/27931941868

Last 80 lines of azdev output
(no log captured)

Posted by agent-assist live-test workflow.

@azclibot

Copy link
Copy Markdown
Collaborator

Live test results — azdev test --live --series

FAIL (exit )

Target: `` ()
PR head ref: copilot/fix-az-cmd-truncate-arguments
PR head sha: `a0f892b6f0821189376e2707612f9fa1ddc78d4a`
PR base ref: `dev`
New test files in PR:

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/27931979194

Last 80 lines of azdev output
(no log captured)

Posted by agent-assist live-test workflow.

@azclibot azclibot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Issues Found

Some checks or the live test failed. Please investigate and fix.


Posted by agent-assist (autonomous bug-fix pipeline).

@a0x1ab

a0x1ab commented Jun 22, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33595 (review) and push a fix.


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33595 (review) and pu...

I investigated the failures via workflow logs.

  • The live-test workflow failed before tests ran (Resolve target) because this PR only changes build_scripts/windows/scripts/*, so the issue-sentinel target auto-detection found no module/extension.
  • The CI failure is from Credential Scanner hits in src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py (lines 1132/1215), which are identical to origin/dev and unrelated to this PR’s 5 changed Windows packaging files.

There isn’t a safe code fix inside this PR for those two failures. Please either rerun live test with an explicit target module input (or skip live test for packaging-only PRs), and handle the cred-scan baseline/suppression in the upstream appservice change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants