Content-Length: 307725 | pFad | http://github.com/npm/cli/pull/8297/commits/08ae095fe58308c4201aae022f6d248024cdce4a

09 fix(powershell): support pipeline input with Invoke-Expression by alexsch01 · Pull Request #8297 · npm/cli · GitHub
Skip to content

fix(powershell): support pipeline input with Invoke-Expression #8297

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

Merged
merged 1 commit into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(powershell): support pipeline input with Invoke-Expression
  • Loading branch information
alexsch01 authored May 15, 2025
commit 08ae095fe58308c4201aae022f6d248024cdce4a
4 changes: 3 additions & 1 deletion bin/npm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ if ($MyInvocation.Line) { # used "-Command" argument

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | Invoke-Expression "& `"$NODE_EXE`" `"$NPM_CLI_JS`" $NPM_ARGS"
$input = (@($input) -join "`n").Replace("``", "````")

Invoke-Expression "Write-Output `"$input`" | & `"$NODE_EXE`" `"$NPM_CLI_JS`" $NPM_ARGS"
} else {
Invoke-Expression "& `"$NODE_EXE`" `"$NPM_CLI_JS`" $NPM_ARGS"
}
Expand Down
4 changes: 3 additions & 1 deletion bin/npx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ if ($MyInvocation.Line) { # used "-Command" argument

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | Invoke-Expression "& `"$NODE_EXE`" `"$NPX_CLI_JS`" $NPX_ARGS"
$input = (@($input) -join "`n").Replace("``", "````")

Invoke-Expression "Write-Output `"$input`" | & `"$NODE_EXE`" `"$NPX_CLI_JS`" $NPX_ARGS"
} else {
Invoke-Expression "& `"$NODE_EXE`" `"$NPX_CLI_JS`" $NPX_ARGS"
}
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/npm/cli/pull/8297/commits/08ae095fe58308c4201aae022f6d248024cdce4a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy