![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Catching stdout AND stderr Hi all, I'm calling some cygwin utility from PSH: rsyncn scp, ssh... I would like to know how I can catch stdout AND stderr at the same time ? Thanks for your help. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Catching stdout AND stderr Romu wrote: Quote: > Hi all, > I'm calling some cygwin utility from PSH: rsyncn scp, ssh... > > I would like to know how I can catch stdout AND stderr at the same time ? > > Thanks for your help. look into start-transcript/stop-transcript. Marco -- ---------------- PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Catching stdout AND stderr On Sep 13, 9:34 am, Romu <R...@xxxxxx> wrote: Quote: > Hi all, > I'm calling some cygwin utility from PSH: rsyncn scp, ssh... > > I would like to know how I can catch stdout AND stderr at the same time ? > > Thanks for your help. Try: ps> scp args > log.txt 2>&1 This is the same syntax as unix/dos and works fine with legacy apps. It's not so good with native powershell cmdlets though since powershell has a few more "streams" apart from stdout/stderr. This is a popular request (nay, pleading?) from v1 powershell users. - Oisin |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Catching stdout AND stderr "Oisin Grehan" <oising@xxxxxx> wrote in message news:1189728583.046781.265180@xxxxxx Quote: > On Sep 13, 9:34 am, Romu <R...@xxxxxx> wrote: Quote: >> Hi all, >> I'm calling some cygwin utility from PSH: rsyncn scp, ssh... >> >> I would like to know how I can catch stdout AND stderr at the same time ? >> >> Thanks for your help. > Hi Romu, > > Try: > > ps> scp args > log.txt 2>&1 > > This is the same syntax as unix/dos and works fine with legacy apps. > It's not so good with native powershell cmdlets though since > powershell has a few more "streams" apart from stdout/stderr. This is > a popular request (nay, pleading?) from v1 powershell users. https://connect.microsoft.com/feedba...7055&SiteID=99 -- Keith |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Catching stdout AND stderr It works thanks. But what about args ?? My arguments are stored in PoSH variables. That's why, from now, my script is writtent calling utilities with "Invoke-Expression" as I have to format my input before. I've just tried to call with something like: scp $mypc and this doesn't work. Any solution using Invoke-Expression? "Oisin Grehan" wrote: Quote: > On Sep 13, 9:34 am, Romu <R...@xxxxxx> wrote: Quote: > > Hi all, > > I'm calling some cygwin utility from PSH: rsyncn scp, ssh... > > > > I would like to know how I can catch stdout AND stderr at the same time ? > > > > Thanks for your help. > Hi Romu, > > Try: > > ps> scp args > log.txt 2>&1 > > This is the same syntax as unix/dos and works fine with legacy apps. > It's not so good with native powershell cmdlets though since > powershell has a few more "streams" apart from stdout/stderr. This is > a popular request (nay, pleading?) from v1 powershell users. > > - Oisin > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Deadlock when logging to stdout and stderr | PowerShell | |||
| StdOut and StdErr reading... | VB Script | |||
| redirect powershell stdout to objShell.Exec.Stdout.ReadAll()( | PowerShell | |||
| Output to STDERR | PowerShell | |||
| Help with stderr from native console application | PowerShell | |||