Skip to content

fix(powershell): don't use Invoke-Expression if ExpectingInput #8303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

alexsch01
Copy link
Contributor

@alexsch01 alexsch01 commented May 16, 2025

dang, my apologies for getting this out after the npm release

this prevents a performance/security regression with piping strings into npm/npx

This should block nodejs/node#58347


echo "Hello" | npm help a=1,b=2,c=3

will use the old logic and print out

No matches in help for: a=1 b=2 c=3

npm help a=1,b=2,c=3

will use the new logic and print out

No matches in help for: a=1,b=2,c=3

This is the best compromise between convenience and security

@alexsch01
Copy link
Contributor Author

alexsch01 commented May 18, 2025

@wraithgar can you review when you have a chance?

@alexsch01
Copy link
Contributor Author

Cleaned up the if and else statements to make things easier to understand

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