Skip to content

feat(ir): add typed helpers for PowerShell@2#1051

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-powershell-v2-typed-helper-3105f1f90754dd0e
Jun 16, 2026
Merged

feat(ir): add typed helpers for PowerShell@2#1051
jamesadevine merged 1 commit into
mainfrom
feat/ir-powershell-v2-typed-helper-3105f1f90754dd0e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds two typed factory functions for PowerShell@2 to src/compile/ir/tasks.rs.

Motivation

Previously, any code that needed to emit a PowerShell@2 task step had to
hand-craft TaskStep::new("PowerShell@2", ...) with raw string inputs. This PR
introduces 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 functions
    • powershell_file_step(file_path) — runs a .ps1 file via targetType: filePath
    • powershell_inline_step(script) — runs an inline block via targetType: inline
  • Six unit tests covering required inputs, optional inputs, error/exit flags, multiline scripts, and both modes

ADO Task Reference

Validation

  • cargo build --all-targets
  • cargo test (6 new tests, all pass)
  • cargo clippy --all-targets --all-features --workspace -- -D warnings

Created by the ado-task-ir-contributor workflow.

Generated by ADO Task IR Contributor · 596.1 AIC · ⌖ 31.9 AIC · ⊞ 36.6K ·

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 jamesadevine marked this pull request as ready for review June 16, 2026 13:21
@jamesadevine jamesadevine merged commit c752f81 into main Jun 16, 2026
@jamesadevine jamesadevine deleted the feat/ir-powershell-v2-typed-helper-3105f1f90754dd0e branch June 16, 2026 13:22
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.

1 participant