-
Notifications
You must be signed in to change notification settings - Fork 905
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
choco.exe: write to stderr and stdout #876
Comments
@sergey-s-betke You are calling an external process, not a PowerShell script. You can't simply use common parameters I would suggest a search for suggestions on how you can do this - https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=outvariable+errorvariable+powershell+external+command |
@ferventcoder , I use advanced function syntax ( |
@ferventcoder, for example, change line
to
and If I change line to
and But for |
@sergey-s-betke choco just has regular stdout and stderr, so it's not on Chocolatey's end that this issue happens. By the way run |
five minutes, please... |
The second is a PowerShell error because you are not calling any process, so you are getting regular PowerShell error output. |
Try this
See if you get any output. |
'Stream' variables is empty... Thank You, I must search another solution for streams redirecting. |
Here's a pretty advanced scenario for redirecting output - choco/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 Lines 131 to 175 in ab78454
|
Thank You! Ten minutes... |
@ferventcoder, script:
It worked! But |
Change $process.StartInfo = [System.Diagnostics.ProcessStartInfo]::new($env:ComSpec, '/C choco install font.gost2.304-81.install --force --confirm -pre --source "release/font.gost2.304-81.install/0.7.4"'); to $process.StartInfo = [System.Diagnostics.ProcessStartInfo]::new("$env:ChocolateyInstall\bin\choco.exe", 'install font.gost2.304-81.install --force --confirm -pre --source "release/font.gost2.304-81.install/0.7.4"'); I'm not sure I follow the purpose of this testing. While it is fine to capture both to determine if there were errors, you can simply look at exit code is not in a set defined in #512 (0 is not the only successful exit code) to determine if it failed. In the way you are doing it feels a little much. You can find the duration time using |
The reason I bring this up is that your output will be separated from your stderr, which may make it harder to pinpoint when that happened. |
What You Are Seeing?
choco.exe
does not write to stdout and stderr:choco 0.9.10.3. I run
choco.exe
for test my chocolatey package on appveyor build server:And I can not redirect stdErr and stdErr choco streams! Why?
What is Expected?
choco.exe
must write TRADITIONALY tostdout
and errors - tostderr
. With powershell I can't detect, successfully completed the test or not!The text was updated successfully, but these errors were encountered: