![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | PowerShell hangs when run from 24x7 Hi people, I'm trying to run a PowerShell job under the 24x7 scheduler but it hangs every time. The same job works fine under Windows Scheduler. The actual job which is hanging is more convoluted than this, but this simplified code illustrates the problem: If I create a job which calls a DOS command it works fine, e.g.: cmd /c dir If I create a job which calls a PowerShell command the job hangs: powershell get-date In the Windows PowerShell log there's 7 messages for 'provider's starting, followed by the engine state changing to available. These messages mirror the same PowerShell command being successfully run from the DOS prompt; EXCEPT from the DOS prompt there's then 7 corresponding messages about providers stopping plus the engine being unavailable. i.e. From my reading PowerShell is starting up OK and not hanging until after startup. There's nothing in the Application/Security/System logs. Assuming no-one has any immediate ideas, is there a debugging switch me or the 24x7 developers can turn on to pinpoint where the problem is? 24x7 Multi-Platform edition 4.1 under Windows XP Pro SP2; Windows PowerShell 1.0 TIA |
My System Specs![]() |
| | #2 (permalink) |
| | Re: PowerShell hangs when run from 24x7 Tom Robinson wrote: Quote: > Hi people, > > I'm trying to run a PowerShell job under the 24x7 scheduler but it > hangs every time. The same job works fine under Windows Scheduler. > > The actual job which is hanging is more convoluted than this, but this > simplified code illustrates the problem: > > If I create a job which calls a DOS command it works fine, e.g.: > > cmd /c dir > > If I create a job which calls a PowerShell command the job hangs: > > powershell get-date > > In the Windows PowerShell log there's 7 messages for 'provider's > starting, followed by the engine state changing to available. > > These messages mirror the same PowerShell command being successfully > run from the DOS prompt; EXCEPT from the DOS prompt there's then 7 > corresponding messages about providers stopping plus the engine being > unavailable. > > i.e. From my reading PowerShell is starting up OK and not hanging > until after startup. > > There's nothing in the Application/Security/System logs. > > Assuming no-one has any immediate ideas, is there a debugging switch > me or the 24x7 developers can turn on to pinpoint where the problem > is? > > 24x7 Multi-Platform edition 4.1 under Windows XP Pro SP2; Windows > PowerShell 1.0 > > TIA > scheduler. It appears 7x24 must handle that differently. Just for fun, try running from within VBScript while hiding the popup window: http://blog.sapien.com/current/2006/...owershell.html Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #3 (permalink) |
| | Re: PowerShell hangs when run from 24x7 Try launching with the -noprofile -nointeractive switches. powershell.exe -noprofile -nointeractive -command "get-date" "Tom Robinson" <barefootguru@xxxxxx> wrote in message news:1193368698.541224.261020@xxxxxx Quote: > Hi people, > > I'm trying to run a PowerShell job under the 24x7 scheduler but it > hangs every time. The same job works fine under Windows Scheduler. > > The actual job which is hanging is more convoluted than this, but this > simplified code illustrates the problem: > > If I create a job which calls a DOS command it works fine, e.g.: > > cmd /c dir > > If I create a job which calls a PowerShell command the job hangs: > > powershell get-date > > In the Windows PowerShell log there's 7 messages for 'provider's > starting, followed by the engine state changing to available. > > These messages mirror the same PowerShell command being successfully > run from the DOS prompt; EXCEPT from the DOS prompt there's then 7 > corresponding messages about providers stopping plus the engine being > unavailable. > > i.e. From my reading PowerShell is starting up OK and not hanging > until after startup. > > There's nothing in the Application/Security/System logs. > > Assuming no-one has any immediate ideas, is there a debugging switch > me or the 24x7 developers can turn on to pinpoint where the problem > is? > > 24x7 Multi-Platform edition 4.1 under Windows XP Pro SP2; Windows > PowerShell 1.0 > > TIA > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: PowerShell hangs when run from 24x7 In article <2FE27E71-BFC8-42ED-BB1E-CC7CDE2F9CAC@xxxxxx>, "Brandon Shell [MVP]" <a_bshell@xxxxxx> wrote: Quote: > "Tom Robinson" <barefootguru@xxxxxx> wrote in message > news:1193368698.541224.261020@xxxxxx Quote: > > Hi people, > > > > I'm trying to run a PowerShell job under the 24x7 scheduler but it > > hangs every time. The same job works fine under Windows Scheduler. > Try launching with the -noprofile -nointeractive switches. > powershell.exe -noprofile -nointeractive -command "get-date" |
My System Specs![]() |
| | #5 (permalink) |
| | Re: PowerShell hangs when run from 24x7 I'm not sure why 24x7 is messing up, but have you tried a batch wrapper just to see if that is the problem? @echo off powershell.exe -noprofile -nointeractive -command "get-date" It would seem to me, since this works with Task Scheduler, the problem is with 24x7 "Tom Robinson" <barefootguru@xxxxxx> wrote in message news:barefootguru-5E79D7.11172227102007@xxxxxx Quote: > In article <2FE27E71-BFC8-42ED-BB1E-CC7CDE2F9CAC@xxxxxx>, > "Brandon Shell [MVP]" <a_bshell@xxxxxx> wrote: > Quote: >> "Tom Robinson" <barefootguru@xxxxxx> wrote in message >> news:1193368698.541224.261020@xxxxxx Quote: >> > Hi people, >> > >> > I'm trying to run a PowerShell job under the 24x7 scheduler but it >> > hangs every time. The same job works fine under Windows Scheduler. >> Try launching with the -noprofile -nointeractive switches. >> powershell.exe -noprofile -nointeractive -command "get-date" > OK, tried that (it's -noninteractive) plus -nologo, but still hangs... |
My System Specs![]() |
| | #6 (permalink) |
| | Re: PowerShell hangs when run from 24x7 In article <ObyP4Z8FIHA.1208@xxxxxx>, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote: Quote: > Tom Robinson wrote: Quote: > > I'm trying to run a PowerShell job under the 24x7 scheduler but it > > hangs every time. The same job works fine under Windows Scheduler. > There is still a popup that appears when called from an automated > scheduler. It appears 7x24 must handle that differently. Just for fun, > try running from within VBScript while hiding the popup window: > http://blog.sapien.com/current/2006/...d-powershell.h > tml It's not going to help my production job though, which is a SAS program which reads the output from PowerShell via a pipe. Is there another way to disable the popup? Something I can give the 24x7 developers? Thanks. |
My System Specs![]() |
| | #7 (permalink) |
| | Re: PowerShell hangs when run from 24x7 In article <E7F2C446-4AEC-4FFA-80D3-75B873DBB8A5@xxxxxx>, "Brandon Shell [MVP]" <a_bshell@xxxxxx> wrote: Quote: > I'm not sure why 24x7 is messing up, but have you tried a batch wrapper just > to see if that is the problem? > > @echo off > powershell.exe -noprofile -nointeractive -command "get-date" successful. Quote: > It would seem to me, since this works with Task Scheduler, the problem is > with 24x7 PowerShell. What I need to do is narrow it down enough so the 24x7 developers know how to fix it, or figure out a workaround. 24x7 support wrote: Quote: > I can reproduce this issue on WinXP system. Indeed powershell.exe appears to > be hung and not doing anything. Process Explorer likely shows that it is > waiting for some NET event. I think the best place to continue > troubleshooting this, is to post a question in one of the MS support forums > for NET/Powershell technologies and check how to troubleshoot this issue. If > you can somehow debug the Powershell process and find out what resource or > event it is waiting for, you can then figure out how to workaround that the > entire issue. |
My System Specs![]() |
| | #8 (permalink) |
| | Re: PowerShell hangs when run from 24x7 if using VBScript works and Powershell and CMD do not then I think the problem is the way they handle the app. It would seem like they are looking for something that powershell and CMD are not returning, thus they just wait. I would be curious if you dont hide the window in vbscript if it still works. "Tom Robinson" <barefootguru@xxxxxx> wrote in message news:barefootguru-381ECE.13594727102007@xxxxxx Quote: > In article <E7F2C446-4AEC-4FFA-80D3-75B873DBB8A5@xxxxxx>, > "Brandon Shell [MVP]" <a_bshell@xxxxxx> wrote: > Quote: >> I'm not sure why 24x7 is messing up, but have you tried a batch wrapper >> just >> to see if that is the problem? >> >> @echo off >> powershell.exe -noprofile -nointeractive -command "get-date" > That hangs too, though Marco's idea of calling it from VBScript was > successful. > Quote: >> It would seem to me, since this works with Task Scheduler, the problem is >> with 24x7 > Well there's certainly a problem with the interaction between 24x7 and > PowerShell. What I need to do is narrow it down enough so the 24x7 > developers know how to fix it, or figure out a workaround. > > 24x7 support wrote: > Quote: >> I can reproduce this issue on WinXP system. Indeed powershell.exe appears >> to >> be hung and not doing anything. Process Explorer likely shows that it is >> waiting for some NET event. I think the best place to continue >> troubleshooting this, is to post a question in one of the MS support >> forums >> for NET/Powershell technologies and check how to troubleshoot this issue. >> If >> you can somehow debug the Powershell process and find out what resource >> or >> event it is waiting for, you can then figure out how to workaround that >> the >> entire issue. > Cheers |
My System Specs![]() |
| | #9 (permalink) |
| | Re: PowerShell hangs when run from 24x7 In article <DEC0E955-EAE8-4408-B73E-08F169258910@xxxxxx>, "Brandon Shell [MVP]" <a_bshell@xxxxxx> wrote: Quote: > if using VBScript works and Powershell and CMD do not then I think the > problem is the way they handle the app. It would seem like they are looking > for something that powershell and CMD are not returning, thus they just > wait. I would be curious if you dont hide the window in vbscript if it still > works. job still works... CMD works for batch files, it's only when using CMD to call PowerShell that it also hangs. |
My System Specs![]() |
| | #10 (permalink) |
| | Re: PowerShell hangs when run from 24x7 in that case I would ask the 24x7 guys what they wait for after a command has started Hello Tom, Quote: > In article <DEC0E955-EAE8-4408-B73E-08F169258910@xxxxxx>, > "Brandon Shell [MVP]" <a_bshell@xxxxxx> wrote: Quote: >> if using VBScript works and Powershell and CMD do not then I think >> the problem is the way they handle the app. It would seem like they >> are looking for something that powershell and CMD are not returning, >> thus they just wait. I would be curious if you dont hide the window >> in vbscript if it still works. >> > the job still works... > > CMD works for batch files, it's only when using CMD to call PowerShell > that it also hangs. > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Automatic PowerShell Error Parsing in PowerShell Analyzer and PowerShellPlus | PowerShell | |||
| PowerShell Leaders Join Forces and offer a pre-release version of PowerShell for 50% off the retail value | PowerShell | |||
| PowerShell hangs while getting data from Web Service. Please Help. | PowerShell | |||
| PowerShell windows hangs after VS 2005 SP 1 update | PowerShell | |||
| PowerShell RTW hangs on startup | PowerShell | |||