Skip to content

Support PowerShell 7#3759

Draft
markmssd wants to merge 2 commits intobuildkite:mainfrom
markmssd:buildkite-hooks-shell
Draft

Support PowerShell 7#3759
markmssd wants to merge 2 commits intobuildkite:mainfrom
markmssd:buildkite-hooks-shell

Conversation

@markmssd
Copy link

@markmssd markmssd commented Mar 15, 2026

Description

PowerShell 5.1 is the latest supported version, and does not receive any more updates. See https://learn.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.5#windows-powershell-release-history. They now focus on the cross-platform version 7.

Difference between v5 and v7: https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.5#powershell-executable-changes

Buildkite Agent targets PowerShell 5.1 on Windows, which is convenient because it's always pre-installed on modern Windows. However, it'd be nice to configure it to use PowerShell 7 instead.

Context

Closes #3657

Changes

This PR does a few things to make it work:

  • Look for .ps1 hooks even on non-Windows OS
  • Add a new configuration BUILDKITE_HOOKS_SHELL / --hooks-shell, which works similar to BUILDKITE_SHELL/--shell, but for the Agent Hooks.

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go tool gofumpt -extra -w .)

Disclosures / Credits

@quinn-diesel
Copy link

hey @markmssd just wanted to jump in to confirm that we've got the PR on our list. we've been very swamped this week but we'll have a close look soon for you.

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.

--shell does not work for global agent hooks

2 participants