Release Automation

Expand all | Collapse all

How to get an output for powershell script?

Jump to Best Answer
  • 1.  How to get an output for powershell script?

    Posted 08-31-2015 04:33 AM

    Kindly give me an solution for getting the output... i am using RUN COMMAND LINE action in nolio for executing the powershell script and while testing the action i am not getting the result. There was also a fishy like when i give "stdout" path till a folder it and after test it automatically changing to a file but in that nothing is written...



  • 2.  Re: How to get an output for powershell script?
    Best Answer

    Posted 08-31-2015 04:59 AM

    Hi

    I tried simple powershell script that print my hostname and I see it in the action output as expected

    powershell.png

    Did you try running the script from the windows command line?

    Sometime it can be related to RA agent service permission (e.g when running RA agent  as local service account Vs user account)

    Thanks

    Jacky



  • 3.  Re: How to get an output for powershell script?

    Posted 08-31-2015 06:23 AM

    Yes i tried running the same script from my cmd there i am getting correct output..



  • 4.  Re: How to get an output for powershell script?

    Posted 08-31-2015 08:33 AM

    Does the RA agent service running with your user credentials as well?

    Did you try using simple script (e.g that print only the hostname) and see if you get any output?



  • 5.  Re: How to get an output for powershell script?

    Posted 09-01-2015 01:12 AM

    Yes its running with my credentials..

     

    Thanks, i tried solving the problem now i am getting the correct output in a file in my local directory...



  • 6.  Re: How to get an output for powershell script?

    Posted 08-31-2015 12:07 PM

    Hi,

     

    i think you u should use the "Run PowerShell Script" Action from the Microsoft Powershell Action Pack.

    You also need to make sure you run the right Version of Powershell for you script (x86/x64 and PS Version).

     

    Also make sure that the Agent has permissions to run powershell scripts.



  • 7.  Re: How to get an output for powershell script?

    Posted 09-01-2015 01:14 AM

    Hi,

     

    Thanks for the reply...

     

    Is there a way where i can print my output into xls. file from my Execution Server into Agent ...