• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfexecute powershell timeout

New Here ,
Apr 24, 2012 Apr 24, 2012

Copy link to clipboard

Copied

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

TOPICS
Advanced techniques

Views

3.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Apr 24, 2012 Apr 24, 2012

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"

        ...

     />

Votes

Translate

Translate
Valorous Hero ,
Apr 24, 2012 Apr 24, 2012

Copy link to clipboard

Copied

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"

        ...

     />

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2012 Apr 25, 2012

Copy link to clipboard

Copied

Thank you.  That did the trick.  Took me a few minutes to figure out where in my string to put the command, but it now works like a charm.  I did read that blog entry, but I guess I didn't get far enough down into the comments.  In my hurry I sometimes forget there's lots of goodness there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 25, 2012 Apr 25, 2012

Copy link to clipboard

Copied

LATEST

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 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation