Skip navigation
Byron.Marsh
Currently Being Moderated

cfexecute powershell timeout

Apr 24, 2012 7:49 AM

Tags: #exchange #timeout #powershell #cfexecute #msonline

First let me say that I am a novice when it comes to Powershell and cfcexecute, though I've been using CF on and off since version 4.

 

I have a PowerShell/Migration shell console file script that updates email passwords on our MSOnline instance.  It works fine if I run it from the run or command line in Windows, but from cfexecute in Coldfusion 9.0.1 it times out.  If I set the timeout to 0 the timeout is ignored, but I'll have no idea if it ran.  The odd thing is that the code actually does its job, but it leaves both the cmd.exe and powershell.exe processes running and I never get a return code regardless of how long I set the timeout.  I have tried all of the /c, 2>$1, exit code, etc., I could find, but none of them seem to work.

 

I have also tried running the console script from a bat file and directly running Powershell command, but I get the same result when using cfexecute.  Besides being over 87MB per instance Powershell, I really don't want to leave a bunch of orphaned processes running.

 

I'm sure there are better ways of doing this.  Any thoughts would be appreciated.

 

Thanks,

Byron

 
Replies
  • Currently Being Moderated
    Apr 24, 2012 7:29 PM   in reply to Byron.Marsh

    Try the tip from James in the comments of this Ben Forta entry.  ie Add the "-inputformat none" paramater.

     

    ie

    <cfexecute name="c:\path\to\powershell.exe"

            arguments="-inputformat none c:\path\tosomeFile.ps1"

            ...

         />

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 10:11 AM   in reply to Byron.Marsh

    No worries, I know the feeling. Popular sites tend to have tons of comments. While some are true jewels, they are in no particular order. So the brain tends to skim after a while ;-)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points