Skip to content

Add PwshHandler for native PowerShell 7.0+ Tasks#5530

Open
MJECloud wants to merge 2 commits into
microsoft:masterfrom
MJECloud:master
Open

Add PwshHandler for native PowerShell 7.0+ Tasks#5530
MJECloud wants to merge 2 commits into
microsoft:masterfrom
MJECloud:master

Conversation

@MJECloud
Copy link
Copy Markdown

Context

This PR adds support for a new Pwsh task execution handler so tasks can explicitly run with PowerShell 7+ (pwsh) on Windows, Linux, and macOS.

The motivation is to build tasks for AzureDevOps which can be pure written in PowerShell like PowerShell3 and PowerShellExeHandler - No Typescript/Node needed.

Closes #4386


Description

Introduces a new Pwsh execution entry in task execution data and wires it through handler selection, handler creation, and execution.


Risk Assessment (Low)


Unit Tests Added or Updated (Yes)


Additional Testing Performed

  • Real pipeline validation on Windows using a patched self-hosted agent
  • Real pipeline validation on Ubuntu using a patched self-hosted agent
  • Successful execution of a simple Pwsh smoke task
  • Successful execution of a richer task using a modificated bundled VstsTaskSdk (Also created a PR for that)
  • Failure-path validation when pwsh is missing, verifying that the task fails explicitly

Change Behind Feature Flag (No)


Tech Design / Approach

  • Keeps Pwsh compatible with existing PowerShell task packaging (VstsTaskSdk + target)
  • Adds a separate cross-platform handler instead of extending legacy Windows-only handlers
  • Resolves pwsh at execution time, not at agent startup
  • Supports container step hosts through the modern handler execution path
  • Does not fall back to Windows PowerShell, so Pwsh stays explicit and predictable

Documentation Changes Required (No)


Logging Added/Updated (Yes)


Telemetry Added/Updated (No)


Rollback Scenario and Process (No)

It's not breaking any working functionality

Dependency Impact Assessed and Regression Tested (Yes)

  • All impacted internal modules, APIs, services, and third-party libraries are analyzed.
  • Results are reviewed and confirmed to not break existing functionality.

@MJECloud MJECloud requested review from a team as code owners April 18, 2026 21:25
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
1 pipeline(s) require an authorized user to comment /azp run to run.

@MJECloud
Copy link
Copy Markdown
Author

@geekzter any chance that someone can look into that? 😊
Thank you in advance!

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
1 pipeline(s) require an authorized user to comment /azp run to run.

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
1 pipeline(s) require an authorized user to comment /azp run to run.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[enhancement]: Extensions with Powershell Core execution handler

1 participant