Skip to content

fix: use Get-Content for PS 5.1 pipeline test compatibility - #113

Merged
AaronFeledy merged 1 commit into
mainfrom
fix/windows-pipeline-test-ps51-compat
Jan 3, 2026
Merged

AaronFeledy merged 1 commit into
mainfrom
fix/windows-pipeline-test-ps51-compat

Conversation

@AaronFeledy

@AaronFeledy AaronFeledy commented Jan 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fixes PowerShell 5.1 pipeline test by using Get-Content -Raw | Invoke-Expression instead of Invoke-WebRequest with file:// URLs
  • Both PS 5.1 and PS 7 tests now use the identical pattern, verifying the documented one-liner works across all PowerShell versions

Root Cause

Invoke-WebRequest with file:// protocol URLs throws NullReferenceException in PowerShell 5.1:

Invoke-WebRequest : Object reference not set to an instance of an object.

Solution

Use Get-Content -Raw | Invoke-Expression for local file testing in both PS versions. This mirrors the documented user command pattern:

iex (irm 'https://get.lando.dev/setup-lando.ps1' -UseB)

Both patterns pipe script content to Invoke-Expression, ensuring the test validates what users actually execute.

Fixes CI failure in PR #111


Note

Fix Windows pipeline script invocation

  • In .github/workflows/pr-windows-script-pipeline-tests.yml, replace PS 5.1 step using Invoke-WebRequest file:// with Get-Content -Raw | Invoke-Expression
  • Align PS 7 step to the same Get-Content -Raw | Invoke-Expression pattern
  • Continues validating installed script via Test-Path and lando version --all

Written by Cursor Bugbot for commit 17b7b75. This will update automatically on new commits. Configure here.

… test

Invoke-WebRequest with file:// URLs throws NullReferenceException in
PowerShell 5.1. Use Get-Content -Raw like the PowerShell 7 test does.
@netlify

netlify Bot commented Jan 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for setup-lando ready!

Name Link
🔨 Latest commit 17b7b75
🔍 Latest deploy log https://app.netlify.com/projects/setup-lando/deploys/6959993beb58240008362c4f
😎 Deploy Preview https://deploy-preview-113--setup-lando.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 51 (🔴 down 8 from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jan 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for get-lando canceled.

Name Link
🔨 Latest commit 17b7b75
🔍 Latest deploy log https://app.netlify.com/projects/get-lando/deploys/6959993b9cfe3f0008ccf6a3

@AaronFeledy
AaronFeledy merged commit 9e0df10 into main Jan 3, 2026
298 of 315 checks passed
@AaronFeledy
AaronFeledy deleted the fix/windows-pipeline-test-ps51-compat branch January 3, 2026 22:39
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