-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhat.txt
More file actions
1 lines (1 loc) · 661 Bytes
/
Copy pathwhat.txt
File metadata and controls
1 lines (1 loc) · 661 Bytes
1
Set-Content -Path ".\tmp_stdin.txt" -Value "hello"; Remove-Item ".\tmp_start_out.txt",".\tmp_start_err.txt" -ErrorAction SilentlyContinue; $p = Start-Process -FilePath npm -ArgumentList 'start' -PassThru -RedirectStandardInput ".\tmp_stdin.txt" -RedirectStandardOutput ".\tmp_start_out.txt" -RedirectStandardError ".\tmp_start_err.txt"; Wait-Process -Id $p.Id -Timeout 20 -ErrorAction SilentlyContinue; if (-not $p.HasExited) { Stop-Process -Id $p.Id -Force }; "---STDOUT---"; if (Test-Path ".\tmp_start_out.txt") { Get-Content ".\tmp_start_out.txt" -Tail 80 }; "---STDERR---"; if (Test-Path ".\tmp_start_err.txt") { Get-Content ".\tmp_start_err.txt" -Tail 80 }