8 Replies Latest reply on Dec 22, 2017 6:45 AM by Bill Robinson

    Redirect the output of Powershell script into single file

    Swatee .

      Hi All,

       

      We are using BSA 8.7 and trying to execute a Power shell script. We have a scenario, where we are creating a job under BSA to execute one power shell script.

      Inside NSH script we are trying the below commands and it is giving the mentioned output.

       

      nexec -i -e cmd /c "echo . | powershell -executionpolicy bypass C:\\xyz\\a.ps1 > C:\tmp\output.txt"         -- Gives output file on Target. 

      nexec -i -e cmd /c "echo . |  powershell -executionpolicy bypass C:\\xyz\\a.ps1 > \\<Server-IP>\C\tmp\output.txt        -- Executes but no output file at given server.

       

      We want the output from all the targets should be saved at one server. But we are getting errors related to path specified.

       

      Please provide some inputs.

       

       

       

      Regards,

      Swati