Release Automation

 View Only
  • 1.  Powershell action return Cannot run program "Powershell.exe" error

    Posted Jun 14, 2016 10:04 AM


    Hi,

    Here's the command I used to run for doing the CDN purge job. It's alway successes at powershell window.

     

    c:\Akamai\Invoke-AkamaiOPEN.ps1 -Method POST -ClientToken "myClientToken" -ClientAccessToken "MyClientAccessToken" -ClientSecret "MyClientSecret" -ReqURL "https://akab-xmucqzwuw3dfqxcg-aywrwrmbvp3o3wi2.purge.akamaiapis.net/ccu/v2/queues/default" -Body '{ "objects": ["http://www.MySite.com/index.asp?type=649&pop=yes&flash=yes"], "action":"invalidate", "type":"arl", "domain":"production" }'

     

    Now I'd like to turn this command into action, so I create a powershell-run script file action.

    螢幕快照 2016-06-14 下午9.55.58.png

    After I test this action locally, RA retrun me an error message.

     

    Error: Exception occurred: Cannot run program "Powershell.exe" (in directory "C:\Akamai"): CreateProcess error=2, The system cannot find the file specified

     

    Both RA server and test agent is in the same computer and I can run the command in powershell window successfully.

    I have no idea why the action can't run Powershell.exe.

     

    Am I set something wrong?

     

    Thanks



  • 2.  Re: Powershell action return Cannot run program "Powershell.exe" error

    Broadcom Employee
    Posted Jun 14, 2016 10:20 AM

    Is this a 64-bit version of PowerShell that you are trying to use here?



  • 3.  Re: Powershell action return Cannot run program "Powershell.exe" error

    Posted Jun 14, 2016 10:23 AM

    I have tried both true or false for 64bit powershell setting, the result is the same...



  • 4.  Re: Powershell action return Cannot run program "Powershell.exe" error
    Best Answer

    Broadcom Employee
    Posted Jun 14, 2016 10:27 AM

    Hi,

       Could this be a permissions issue, is the agent running as the local system account or a named account?  I would try creating a simple action that calls a batch file in the same folder and make sure this works to ensure the agent has permissions in the folder structure. Hope this help

     

    Regards

    Keith



  • 5.  Re: Powershell action return Cannot run program "Powershell.exe" error

    Posted Jun 14, 2016 10:50 AM

    Hi Keith,

    Thank you so much for your idea.

    The Nolio agent was started with local system account. I change it to administrator account for test and the action success.

    The weird thing is...I change the account back to local system afterwards. The action still run successful.



  • 6.  Re: Powershell action return Cannot run program "Powershell.exe" error

    Broadcom Employee
    Posted Jun 14, 2016 10:49 AM

    It seems like the PowerShell binary is not being found based on the error you get.

     

    You may want to test this after configuring the Nolio Agent service to use the local administrator to ensure there are no permission issues and that it is using a user with the powershell exe in its path. If that doesn't help, what version action pack do you have installed?

     

    If it does work but you don't want to continue using the administrator account then it is a matter of finding an appropriate account/permissions/path variable to use.



  • 7.  Re: Powershell action return Cannot run program "Powershell.exe" error

    Posted Jun 14, 2016 10:52 AM

    Thank you Gregg. It's indeed a permission issue.