Daniel Calbimonte shows how to execute Powershell via C# in SQL Server Integration Services:
Get started
The article will include the following topics:
-
Get the list of services using PowerShell in C#.
-
How to send SSIS Parameters to PowerShell using the script task.
-
How to use the PowerShell.addscript function.
-
How to invoke a PowerShell script in C#
I think this is a fairly limited scenario—if you’re going to have to write C# code anyhow, you can do this same work in C#. I suppose that it would be most useful in cases where you have to call common Powershell cmdlets rather than writing your own .NET code.