You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Remove non-existent PowerShell/setup-powershell action reference
- Clarify that PowerShell 7.4+ (pwsh) is pre-installed on all runners
- Document that Windows PowerShell 5.1 (powershell) is Windows-only
- Simplify cross-platform matrix builds (no PowerShell setup needed)
- Add separate example for testing with Windows PowerShell 5.1
- Fix invalid cache path conditional syntax
- Update execution policy troubleshooting with platform clarity
GitHub-hosted runners come with PowerShell pre-installed on all platforms:
41
+
42
+
- **PowerShell 7.4+ (`pwsh`)**: Available on Windows, Linux, and macOS runners
43
+
- **Windows PowerShell 5.1 (`powershell`)**: Only available on Windows runners
44
+
45
+
**Important:** Always use `shell: pwsh` in your workflows for cross-platform compatibility. Only use `shell: powershell` if you specifically need Windows PowerShell 5.1 features.
46
+
38
47
## Installing psake in GitHub Actions
39
48
40
49
There are several approaches to installing psake in your workflow:
**Problem:** Scripts fail due to execution policy on Windows runners
472
495
473
-
**Solution:** Use `pwsh` shell (PowerShell Core) instead of `powershell` (Windows PowerShell):
496
+
**Solution:** Use `shell: pwsh` (PowerShell 7) instead of `shell: powershell` (Windows PowerShell 5.1):
474
497
```yaml
475
498
- name: Run psake
476
-
shell: pwsh # Not 'powershell'
499
+
shell: pwsh # PowerShell 7 - available on all platforms
477
500
run: Invoke-psake
478
501
```
479
502
503
+
**Note:** The `pwsh` shell is available on Windows, Linux, and macOS runners. The `powershell` shell is only available on Windows and may have stricter execution policies.
504
+
480
505
### Build Failures Not Failing the Workflow
481
506
482
507
**Problem:** psake build fails but workflow shows success
0 commit comments