Powershell Execution Via SSIS Failing on Server

Copper Contributor


We have requirement where we need to run the SSIS Package via Execute Process Task in SSIS. The powershell file has parameters which are passed within package at run time. When the code is run locally using SSIS package in VS or using Powershell command window then it runs well. However when deployed on Server, it gives below error (understand this is generic error):

EPT_PowershellForExcelToSQL:Error: In Executing "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-ExecutionPolicy Unrestricted -File D:\Scripts\xxxx\xxxxxx.ps1 -server xxx -database xxx -schema xxx -table xxx -ExecutionId xxx -xlsFile \\xx\xx\yyy.xlsx -sheetname xx | Out-File -FilePath D:\Scripts\xxx\xxx.txt" at "", The process exit code was "1" while the expected was "0".

Note: I've replaced actual values with excel.
We already applied the server settings as per article given at - https://techcommunity.microsoft.com/t5/sql-server-integration-services/run-powershell-scripts-in-ssi...

Kindly advise if there is anything else we are missing.


0 Replies