Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enh Request: Capturing Warning, Verbose, Debug and Host output

14 views
Skip to first unread message

Keith Hill

unread,
Sep 1, 2007, 1:51:06 PM9/1/07
to
It seems like it would be nice these "other" information/output channels
were assigned to streams so they could participate in stream redirection
like stderr (2>&1) e.g.:

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

unread,
Sep 1, 2007, 4:44:39 PM9/1/07
to
Sounds like a good suggestion for vNext, let us know if and when you put it
up in Connect so we can vote on it.

--
Kiron

Keith Hill

unread,
Sep 1, 2007, 5:28:40 PM9/1/07
to
"Kiron" <Ki...@HighPlainsDrifter.com> wrote in message
news:D180C669-A904-4634...@microsoft.com...

> Sounds like a good suggestion for vNext, let us know if and when you put
> it
> up in Connect so we can vote on it.
>

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

Brandon Shell

unread,
Sep 1, 2007, 5:45:34 PM9/1/07
to
Got my vote.

"Keith Hill" <r_keit...@mailhot.moc.no_spam_I> wrote in message
news:F958A8ED-B135-4234...@microsoft.com...

Marco Shaw

unread,
Sep 2, 2007, 8:52:44 PM9/2/07
to
Keith Hill wrote:
> It seems like it would be nice these "other" information/output channels
> were assigned to streams so they could participate in stream redirection
> like stderr (2>&1) e.g.:
>
> 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)

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

Blog:
http://marcoshaw.blogspot.com

Hal Rottenberg

unread,
Sep 2, 2007, 11:07:56 PM9/2/07
to
Marco Shaw wrote:
> 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.)

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/

Keith Hill [MVP]

unread,
Sep 6, 2007, 8:51:39 PM9/6/07
to
"Keith Hill" <r_keit...@mailhot.moc.no_spam_I> wrote in message
news:F958A8ED-B135-4234...@microsoft.com...

OK I submitted this at:

https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=297055&SiteID=99

--
Keith

Hal Rottenberg

unread,
Sep 7, 2007, 1:05:10 PM9/7/07
to

I don't know if it's a cookie issue but I keep getting page not found.

Hal Rottenberg

unread,
Sep 7, 2007, 1:10:10 PM9/7/07
to
Hal Rottenberg wrote:
> Keith Hill [MVP] wrote:
>> OK I submitted this at:
>>
>> https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=297055&SiteID=99
>
>
> 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.

Karl Mitschke

unread,
Sep 25, 2007, 10:30:48 AM9/25/07
to
Hello Keith Hill [MVP],

I voted for this.

Karl


0 new messages