powershell v3.0 - Error redirection not working -


i trying pipe output of script text file.

this works:

myscript > c:\output.txt 

the problem errors not included in output in text file (on screen are).

when this:

myscript 2>&1 c:\output.txt 

no file created (but still see on screen).

i'm using powershell 3.0. doing wrong?

i believe you're looking is:

myscript > c:\output.txt 2>&1 

the "> c:\output.txt" redirects stdout file

the 2>&1 redirects stderr stdout

when you've done stdout redirection, result redirection of both stdout , stderr c:\output.txt

with "2>&1 c:\output.txt" you're redirecting stderr stdout, letting stdout still output console, , merely supplying c:\output.txt unused parameter script.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -