Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Redirect all output

Reply
 
Old 09-16-2008   #1 (permalink)
Daniel Balla


 
 

Redirect all output

How can I redirect the default output to a file?
Is there an alternative to piping everything with an out-file? something
that would affect globally the whole script?

Thanks,
Dan

My System SpecsSystem Spec
Old 09-16-2008   #2 (permalink)
PaulChavez


 
 

RE: Redirect all output

You can use the redirection operator.

Some-CommandorScript > OutputFile


"Daniel Balla" wrote:
Quote:

> How can I redirect the default output to a file?
> Is there an alternative to piping everything with an out-file? something
> that would affect globally the whole script?
>
> Thanks,
> Dan
My System SpecsSystem Spec
Old 09-16-2008   #3 (permalink)
Daniel Balla


 
 

RE: Redirect all output

Thanks mate. that makes sense

"PaulChavez" wrote:
Quote:

> You can use the redirection operator.
>
> Some-CommandorScript > OutputFile
>
>
> "Daniel Balla" wrote:
>
Quote:

> > How can I redirect the default output to a file?
> > Is there an alternative to piping everything with an out-file? something
> > that would affect globally the whole script?
> >
> > Thanks,
> > Dan
My System SpecsSystem Spec
Old 09-18-2008   #4 (permalink)
Brandon Shell [MVP]


 
 

RE: Redirect all output

Be careful... anything written to host (i.e. Write-Host or -verbose output)
will NOT be redirected to file.

Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject

DB> Thanks mate. that makes sense
DB>
DB> "PaulChavez" wrote:
DB>
Quote:
Quote:

>> You can use the redirection operator.
>>
>> Some-CommandorScript > OutputFile
>>
>> "Daniel Balla" wrote:
>>
Quote:

>>> How can I redirect the default output to a file?
>>> Is there an alternative to piping everything with an out-file?
>>> something
>>> that would affect globally the whole script?
>>> Thanks,
>>> Dan

My System SpecsSystem Spec
Old 09-18-2008   #5 (permalink)
Daniel


 
 

RE: Redirect all output

Thanks
how about out-default? what is that?

"Brandon Shell [MVP]" wrote:
Quote:

> Be careful... anything written to host (i.e. Write-Host or -verbose output)
> will NOT be redirected to file.
>
> Brandon Shell
> ---------------
> Blog: http://www.bsonposh.com/
> PSH Scripts Project: www.codeplex.com/psobject
>
> DB> Thanks mate. that makes sense
> DB>
> DB> "PaulChavez" wrote:
> DB>
Quote:
Quote:

> >> You can use the redirection operator.
> >>
> >> Some-CommandorScript > OutputFile
> >>
> >> "Daniel Balla" wrote:
> >>
> >>> How can I redirect the default output to a file?
> >>> Is there an alternative to piping everything with an out-file?
> >>> something
> >>> that would affect globally the whole script?
> >>> Thanks,
> >>> Dan
>
>
>
My System SpecsSystem Spec
Old 09-19-2008   #6 (permalink)
Shay Levy [MVP]


 
 

Re: Redirect all output

Hi Daniel,

You can record your PowerShell session to a file with *-Transcript. Check
the help files for this cmdlets:

Start-Transcript
Stop-Transcript



---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic



DB> How can I redirect the default output to a file?
DB> Is there an alternative to piping everything with an out-file?
DB> something
DB> that would affect globally the whole script?
DB> Thanks,
DB> Dan


My System SpecsSystem Spec
Old 09-22-2008   #7 (permalink)
Brandon Shell [MVP]


 
 

RE: Redirect all output

That is there to allow end users to over-ride the defaults.

get-help out-default -full


Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject

D> Thanks
D> how about out-default? what is that?
D> "Brandon Shell [MVP]" wrote:
D>
Quote:
Quote:

>> Be careful... anything written to host (i.e. Write-Host or -verbose
>> output) will NOT be redirected to file.
>>
>> Brandon Shell
>> ---------------
>> Blog: http://www.bsonposh.com/
>> PSH Scripts Project: www.codeplex.com/psobject
>> DB> Thanks mate. that makes sense
>> DB>
>> DB> "PaulChavez" wrote:
>> DB>
Quote:

>>>> You can use the redirection operator.
>>>>
>>>> Some-CommandorScript > OutputFile
>>>>
>>>> "Daniel Balla" wrote:
>>>>
>>>>> How can I redirect the default output to a file?
>>>>> Is there an alternative to piping everything with an out-file?
>>>>> something
>>>>> that would affect globally the whole script?
>>>>> Thanks,
>>>>> Dan

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Redirect Sound Card Output Vista hardware & devices
How can I redirect output from Invoke-Expression ? PowerShell
URL Redirect Problem Vista General
redirect unicode format output PowerShell
how to redirect whatif output to a file? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46