![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Start-Service return immediately I'm using powershell in VS2005 pre and post build events to start and stop the windows service I'm working on. I need the start-service command to return right away and not wait for the service to start before returning. It's causing a chicken and egg situation. Anyone know how to do this? Here are the details for anyone interested: I have a script that is run on pre-build event to stop the service and record in a scratch file whether the service was running or not. On post-build I have a script that runs to check the scratch file and start the service again if it was running before the rebuild. I'm using Debugger.Launch; Dubugger.Break; in the service startup code so I can jump in and debug the startup logic. Here is where the problem is... the powershell script will not return until the service finishes startup code and the VS2005 IDE won't let me jump into the starup code to debug in the currently open instance becuase it is busy running a post-build event. If the script would return right away and not wait for the service to finish starting then I think I'd be fine. Thanks for the help |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: Start-Service return immediately can you try this ? powerShell {start-service service} or this cmd /c start /b powerShell {start-service wmi} greetings /\/\o\/\/ "Jibbers42" wrote: > I'm using powershell in VS2005 pre and post build events to start and stop > the windows service I'm working on. I need the start-service command to > return right away and not wait for the service to start before returning. > It's causing a chicken and egg situation. Anyone know how to do this? > > Here are the details for anyone interested: > I have a script that is run on pre-build event to stop the service and > record in a scratch file whether the service was running or not. On > post-build I have a script that runs to check the scratch file and start the > service again if it was running before the rebuild. > I'm using Debugger.Launch; Dubugger.Break; in the service startup code so I > can jump in and debug the startup logic. Here is where the problem is... > the powershell script will not return until the service finishes startup code > and the VS2005 IDE won't let me jump into the starup code to debug in the > currently open instance becuase it is busy running a post-build event. If > the script would return right away and not wait for the service to finish > starting then I think I'd be fine. > > Thanks for the help |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with a Service that Fails to Start (Bonjour Service) | Stéphane Bergeron | Vista General | 2 | 07-11-2008 06:21 PM |
| WLAN AutoConfig won't start | Windows Wireless Service won't start.... | wheatln2 | Network & Internet | 4 | 06-14-2008 03:12 PM |
| How is it possible to execute start-service and stop-service through a Web-interface? | Alexander Vasilevsky | PowerShell | 7 | 11-15-2007 08:29 PM |
| Launch Process & return to prompt immediately | Clint Bergman | PowerShell | 3 | 04-28-2007 12:13 PM |
| Vista Event Notification service fails, logs user off immediately | Keith Patrick | Vista security | 0 | 03-29-2007 10:49 AM |