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 - Can parent shell monitor run/crash status of Child shell/exe ?

Reply
 
Old 09-10-2009   #1 (permalink)
sanjeev kumar


 
 

Can parent shell monitor run/crash status of Child shell/exe ?

I am running automated daily-regression tests - various configs.
I have written powershell script invoking EXEs .
But, if any Exe crashes/stops(anything abnormal suspension) , how can my
script track this event?

Can a parent powershell monitor child-shell which then invokes each binary
exec. ?

Any suggestion would be welcome.
Thanks.


My System SpecsSystem Spec
Old 09-10-2009   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: Can parent shell monitor run/crash status of Child shell/exe ?

Can you provide an example? Your main PowerShell script runs these EXEs
asynchronously, or waits until each completes?

Marco

"sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
news:077ACCDA-85CE-4DDF-8C08-8D6343ACC69C@xxxxxx
Quote:

> I am running automated daily-regression tests - various configs.
> I have written powershell script invoking EXEs .
> But, if any Exe crashes/stops(anything abnormal suspension) , how can my
> script track this event?
>
> Can a parent powershell monitor child-shell which then invokes each binary
> exec. ?
>
> Any suggestion would be welcome.
> Thanks.
My System SpecsSystem Spec
Old 09-11-2009   #3 (permalink)
sanjeev kumar


 
 

Re: Can parent shell monitor run/crash status of Child shell/exe ?

Hello marco,

I am trying to achieve automation of daily regression tests, followed by
email-send of the test status.
My powershell script would run the Exe's synchronously, waiting untill each
completes & go onto next.

part of spowershell cript:

.../bin/release/myprog.exe <config-1>
.../bin/release/myprog.exe <config-2>
...
.../bin/debug/myprog.exe <config-1
.../bin/debug/myprog.exe <config-n>
...
<mailsend> <test-status>


Currently, If all the Exe's run to completion, my scripts sends status email
of tests.
But if any of Exe has abnormal termination-problem, popping up
Windows-dialog("want to debug/close?").
(The problem could be some memory-leaks,asserts etc. in the Exe)
So often, my script is stuck & sends no status.

How best to tackle this problem?
-Sanjeev kumar

"Marco Shaw [MVP]" <marco.shaw@xxxxxx_SPAMgmail.com> wrote in message
news:Ok2Pb3nMKHA.5192@xxxxxx
Quote:

> Can you provide an example? Your main PowerShell script runs these EXEs
> asynchronously, or waits until each completes?
>
> Marco
>
> "sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
> news:077ACCDA-85CE-4DDF-8C08-8D6343ACC69C@xxxxxx
Quote:

>> I am running automated daily-regression tests - various configs.
>> I have written powershell script invoking EXEs .
>> But, if any Exe crashes/stops(anything abnormal suspension) , how can my
>> script track this event?
>>
>> Can a parent powershell monitor child-shell which then invokes each
>> binary exec. ?
>>
>> Any suggestion would be welcome.
>> Thanks.
>
My System SpecsSystem Spec
Old 09-11-2009   #4 (permalink)
Marco Shaw [MVP]


 
 

Re: Can parent shell monitor run/crash status of Child shell/exe ?

Well, I can think of 2 approaches.

1. $LASTEXITCODE provides you the exit code of the last run console-based
application (or .EXE).
2. Have your main script write to a log, then possibly have a second script
monitor this log. If all of you jobs should finish within 1 minute, for
example, have your second script make sure that the log has been updated
within the last 1 or 2 minutes or send out an alert email, etc.

How's that sound?

Marco

"sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
news:E1D1DC9D-CAA7-49E0-A538-F1C47CFA76F6@xxxxxx
Quote:

> Hello marco,
>
> I am trying to achieve automation of daily regression tests, followed by
> email-send of the test status.
> My powershell script would run the Exe's synchronously, waiting untill
> each completes & go onto next.
>
> part of spowershell cript:
>
> ../bin/release/myprog.exe <config-1>
> ../bin/release/myprog.exe <config-2>
> ..
> ../bin/debug/myprog.exe <config-1
> ../bin/debug/myprog.exe <config-n>
> ..
> <mailsend> <test-status>
>
>
> Currently, If all the Exe's run to completion, my scripts sends status
> email of tests.
> But if any of Exe has abnormal termination-problem, popping up
> Windows-dialog("want to debug/close?").
> (The problem could be some memory-leaks,asserts etc. in the Exe)
> So often, my script is stuck & sends no status.
>
> How best to tackle this problem?
> -Sanjeev kumar
>
> "Marco Shaw [MVP]" <marco.shaw@xxxxxx_SPAMgmail.com> wrote in message
> news:Ok2Pb3nMKHA.5192@xxxxxx
Quote:

>> Can you provide an example? Your main PowerShell script runs these EXEs
>> asynchronously, or waits until each completes?
>>
>> Marco
>>
>> "sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
>> news:077ACCDA-85CE-4DDF-8C08-8D6343ACC69C@xxxxxx
Quote:

>>> I am running automated daily-regression tests - various configs.
>>> I have written powershell script invoking EXEs .
>>> But, if any Exe crashes/stops(anything abnormal suspension) , how can my
>>> script track this event?
>>>
>>> Can a parent powershell monitor child-shell which then invokes each
>>> binary exec. ?
>>>
>>> Any suggestion would be welcome.
>>> Thanks.
>>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
get child node of selected parent node .NET General
vs shell 2008 PowerShell
Executing Power Shell Scripts from Windows Shell PowerShell
Possible bug in shell? Vista General


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