Skip to content

Commit 11284b1

Browse files
Add docs
1 parent 3b5438e commit 11284b1

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Install-PowerShell
22

3-
A cross‑platform GitHub Action that installs a specific **PowerShell Core** version—or the latest stable release—on any GitHub‑hosted runner
3+
A cross‑platform GitHub Action that installs a specific **PowerShell Core** version—or the latest stable or preview release—on any GitHub‑hosted runner
44
(Linux, macOS, or Windows). The action automatically skips installation when the requested version is already present.
55

66
## Usage
77

88
Add the action to a job in your workflow file:
9-
109
```yaml
1110
jobs:
1211
build:
@@ -25,11 +24,27 @@ jobs:
2524
Write-Host "Using PowerShell $($PSVersionTable.PSVersion)"
2625
```
2726
27+
### Installing preview builds
28+
29+
```yaml
30+
- name: Install PowerShell Preview
31+
uses: PSModule/install-powershell@v1
32+
with:
33+
Version: latest
34+
Preview: true
35+
36+
- name: Run a PowerShell script
37+
shell: pwsh
38+
run: |
39+
Write-Host "Using PowerShell $($PSVersionTable.PSVersion)"
40+
```
41+
2842
## Inputs
2943
3044
| Input | Required | Default | Description |
3145
| ----- | -------- | ------- | ----------- |
32-
| `Version` | `false` | `latest` | Desired PowerShell Core version (e.g. `7.4.1`). Use `latest` to install the newest stable release. |
46+
| `Version` | `false` | `latest` | Desired PowerShell Core version (e.g. `7.4.1`, `7.6.0-preview.1`). Use `latest` to install the newest stable release, or the newest preview release when `Preview` is `true`. |
47+
| `Preview` | `false` | `false` | Install PowerShell preview build instead of stable. When `true` and `Version` is `latest`, installs the latest preview release. |
3348

3449
## Secrets
3550

@@ -43,7 +58,7 @@ This action does **not** generate any outputs.
4358

4459
* **Version resolution**
4560
If `Version` is set to `latest` (case‑insensitive), the action queries the GitHub API for the newest stable release tag in the
46-
`PowerShell/PowerShell` repository and substitutes that version.
61+
`PowerShell/PowerShell` repository and substitutes that version. When `Preview` is `true`, it queries for the latest preview release instead.
4762

4863
* **Skip logic**
4964
Before installing, the action checks the current runner to see whether the requested version is already available

0 commit comments

Comments
 (0)