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 - capture command and its output

Reply
 
Old 02-16-2008   #1 (permalink)
hugh


 
 

capture command and its output

Hi all

I am in the process of learning PS so I am trying the different cmdlets
to see wht they do what the output is etc.

I would like to log my trials to a text file.

I know that I can redirect output with either > or >> or even with |
CLIP (to the clipboard).

The problem is that all the above methods do not capture the onliner
that I try but only its output.

Is there a way to capture not only the oneliner output but also the
oneliner itself?

get-history is not good enough because it shows the oneliners but not
their outputs.

I'd need something that captures like

command1
output1
....
commandn
outputn

Is this possible?

thanks!!!

My System SpecsSystem Spec
Old 02-16-2008   #2 (permalink)
Shay Levi


 
 

Re: capture command and its output



Hi

The Start-Transcript cmdlet creates a record of all or part of a Windows
PowerShell session in a text file.
Type 'help Start-Transcript -full' to get help and examples.

BTW, there's a bug. Start-Transcript won't record legacy applications (exe)
output.



-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> Hi all
>
> I am in the process of learning PS so I am trying the different
> cmdlets to see wht they do what the output is etc.
>
> I would like to log my trials to a text file.
>
> I know that I can redirect output with either > or >> or even with |
> CLIP (to the clipboard).
>
> The problem is that all the above methods do not capture the onliner
> that I try but only its output.
>
> Is there a way to capture not only the oneliner output but also the
> oneliner itself?
>
> get-history is not good enough because it shows the oneliners but not
> their outputs.
>
> I'd need something that captures like
>
> command1
> output1
> ...
> commandn
> outputn
> Is this possible?
>
> thanks!!!
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Hide console and capture output from script? PowerShell
Log command output to a file PowerShell
How to catch a command output ? PowerShell
Writing to host in functions and cmdlets - how to capture this output PowerShell
Capture command result 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