Skip to content

🚀 [Feature]: Support installing prerelease PowerShell versions #15

@MariusStorhaug

Description

Summary

Add support for installing PowerShell prerelease builds in addition to stable releases, following the same UX pattern
as Install-PSResource -Prerelease.

Design

Inputs

Input Required Default Description
Version false latest Desired PowerShell Core version (e.g. 7.4.1, 7.6.0-preview.6). Use latest to install the newest stable release (or newest prerelease when Prerelease is true).
Prerelease false false Install a prerelease version. When true and Version is latest, resolves to the latest prerelease. Similar to -Prerelease on Install-PSResource.

Usage scenarios

Usage Version Prerelease Result
Latest stable latest (default) false (default) Resolves to latest stable via /releases/latest
Latest prerelease latest true Resolves to latest prerelease via /releases API
Specific stable 7.5.0 Installs 7.5.0 directly
Specific prerelease 7.6.0-preview.6 Installs 7.6.0-preview.6 directly (no flag needed)

Examples

Install latest stable (default):

- uses: PSModule/install-powershell@v1

Install the latest prerelease:

- uses: PSModule/install-powershell@v1
  with:
    Prerelease: true

Install a specific prerelease version:

- uses: PSModule/install-powershell@v1
  with:
    Version: 7.6.0-preview.6

Details

  • PowerShell prereleases follow SemVer: Major.Minor.Patch-Label.N (e.g. 7.6.0-preview.6, 7.5.0-rc.1)
  • The GitHub Releases API returns releases sorted by created_at descending, so the first prerelease is the latest
  • Download artifact naming is consistent between stable and prerelease (the version string is used as-is in URLs)
  • On Windows, preview builds install to $env:ProgramFiles\PowerShell\7-preview\ instead of $env:ProgramFiles\PowerShell\7\
  • Windows PowerShell 5.1 (used by the Windows step) lacks [semver] — the downgrade detection strips the prerelease
    suffix before [version] comparison
  • The Windows uninstall registry filter must match *Preview* display names when uninstalling a preview build

Acceptance criteria

  • New Prerelease boolean input added to action.yml
  • latest resolves to the latest prerelease when Prerelease is true
  • Specific prerelease version strings (e.g. 7.6.0-preview.6) install correctly without the flag
  • Windows downgrade detection handles prerelease version strings
  • Windows uninstall filter correctly matches preview display names
  • Works on all supported platforms: Linux, macOS, and Windows
  • CI test matrix covers both prerelease (latest) and specific prerelease versions
  • README documents the new input and provides usage examples

Related

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions