Google Groups Home
Help | Sign in
Message from discussion Enh Request: Capturing Warning, Verbose, Debug and Host output
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Keith Hill  
View profile  
 More options Sep 1 2007, 1:51 pm
Newsgroups: microsoft.public.windows.powershell
From: "Keith Hill" <r_keith_h...@mailhot.moc.no_spam_I>
Date: Sat, 1 Sep 2007 11:51:06 -0600
Local: Sat, Sep 1 2007 1:51 pm
Subject: Enh Request: Capturing Warning, Verbose, Debug and Host output
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google