feat(ir): add typed helpers for PowerShell@2#1051
Merged
jamesadevine merged 1 commit intoJun 16, 2026
Merged
Conversation
Add two factory functions to src/compile/ir/tasks.rs: - powershell_file_step(file_path): runs a .ps1 file via PowerShell@2 with targetType=filePath. Optional inputs: arguments, errorActionPreference, failOnStderr, ignoreLASTEXITCODE, pwsh, workingDirectory. - powershell_inline_step(script): runs an inline PowerShell block via PowerShell@2 with targetType=inline. Same optional inputs minus arguments. Both functions follow the same positional-required / optional-via- with_input pattern used by all other helpers in this module. Six unit tests cover required inputs, optional inputs, error/exit flags, multiline scripts, and both modes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
approved these changes
Jun 16, 2026
This was referenced Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two typed factory functions for
PowerShell@2tosrc/compile/ir/tasks.rs.Motivation
Previously, any code that needed to emit a
PowerShell@2task step had tohand-craft
TaskStep::new("PowerShell@2", ...)with raw string inputs. This PRintroduces two well-typed helpers that make the file-path vs inline distinction
explicit at the call site and document all optional inputs.
Changes
src/compile/ir/tasks.rs: two new factory functionspowershell_file_step(file_path)— runs a.ps1file viatargetType: filePathpowershell_inline_step(script)— runs an inline block viatargetType: inlineADO Task Reference
PowerShell@2targetType,filePathtargetType,scriptarguments,errorActionPreference,failOnStderr,ignoreLASTEXITCODE,pwsh,workingDirectoryValidation
cargo build --all-targetscargo test(6 new tests, all pass)cargo clippy --all-targets --all-features --workspace -- -D warningsCreated by the ado-task-ir-contributor workflow.