0 - stdin
1 - stdout (write-output, normal cmdlet output, non captured expression
output)
2 - stderr (write-error, throw, cmdlet non-terminating errors)
3 - warnings (write-warning, cmdlet warning)
4 - verbose (write-verbose and cmdlet -verbose output)
5 - debug (write-debug and cmdlet debug output)
6 - host (write-host, read-host, explicit out-host use)
9 - combined (all output combined into a single - easy to redirect stream)
So for logging purposes, if I want to capture *ALL* output to a log file I
can simply do this:
C:\MyLongRunningComplexUnattendedScript.ps1 9>&1 >
C:\Logs\CompleteLogFile.log
or if I wanted to capture verbose output in a script:
stop-process -n vd* -verbose 4>&1 > C:\Logs\StoppedProcesses.log
Thoughts?
--
Keith
--
Kiron
I wanted to get a some feedback from this forum to see if others thought
this might be a good idea first. If I submit this to connect, I'll drop a
link to it here.
--
Keith
"Keith Hill" <r_keit...@mailhot.moc.no_spam_I> wrote in message
news:F958A8ED-B135-4234...@microsoft.com...
I'd vote for this. Might want to make the options 1,2,4,8, etc.
That way, one can have 1 and 2, by simply defining 3, etc.
(There's must be a technical name for this combination of options
because I've seen it on MSDN relating to some Internet Explorer related
stuff.)
--
----------------
PowerGadgets MVP
http://www.powergadgets.com/mvp
Bitmasking? http://en.wikipedia.org/wiki/Mask_(computing)
0000 0001 1 - stdout
0000 0010 2 - stderr
0000 0100 4 - warnings
0000 1000 8 - verbose
0000 0011 = 3 = 1+2 = stdout & stderr
I'm neither for nor against your bitmask proposal, just explaining it for
everyone's benefit. :)
--
Hal Rottenberg
blog: http://halr9000.com
powershell category:
http://halr9000.com/article/category/programming/scripting/powershell/
OK I submitted this at:
https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=297055&SiteID=99
--
Keith
I don't know if it's a cookie issue but I keep getting page not found.
Ignore me---forgot I had a second Live ID in which I had not joined the Connect
program.
I voted for this.
Karl