header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

How to catch console output from other application.
Last Post 22 Aug 2008 12:05 PM by Juzzzt. 2 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
JuzzztUser is Offline
New Member
New Member
Posts:2
Avatar

--
21 Aug 2008 04:59 PM  

Question is: How can I catch console output form other application.

For example

I used my lib in the script
(source of the scrpt
    [Reflection.Assembly]::LoadFile("D:\BuildTools\ExecuteSQL\ExecuteSQL.dll")
    [ExecuteSQL.Program]::Start("XXX\XXXXS#Project_1", "file:d:/1.sql")

)

And method "Start" writes to console some log data. But I can't read this data through powershell output. Is there some way to catch it?

halr9000User is Offline
PowerShell MVP, Site Admin
Basic Member
Basic Member
Posts:334
Avatar

--
21 Aug 2008 05:10 PM  
It's usually ridiculously easy. Your program execution method...not as sure. But try this:

$output = [Execute...
Community Director, PowerShellCommunity.org
Co-host, PowerScripting Podcast
Author, TechProsaic
JuzzztUser is Offline
New Member
New Member
Posts:2
Avatar

--
22 Aug 2008 12:05 PM  

I also thought like that. But it doesn't work. "$output" is empty after execution of method. But if I execute this script from cmd I receive Method Output on the screen.

You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer