SSIS package deployed to SQL Server hangs when running a Powershell script We have a SSIS package that tidies up a few files and folders, and want to automate it to run every night via the SQL Server Agent.
When running the package via Visual Studio (2015 and 2017) the package completes successfully. When the package is deployed to SQL Server 2012, it never gets past the element that runs a Powershell script - it simply hangs forever (3 days is the record so far).
SSIS data flow:

&quot;Run Compression PowerShell Script&quot; task:

The Powershell script is very basic - two lines of code:
$filePathName = $args[0];

Compress-Archive -Path $filePathName -DestinationPath $filePathName

We think it may be a permissions issue, but we're not sure where to progress this further.
Any help is gratefully received.
Thank you
The SSIS element was a red herring. The issue was the execution policy being passed to PowerShell when running the script.

Changing from 


  -ExecutionPolicy Unrestricted


to


  -ExecutionPolicy ByPass


has resolved the issue.