views:

80

answers:

1

I would like to execute sqlps scripts from asp.net. With this article I was able to run simple powershell comannds but don't know how to invoke sqlps.

Thanks, Fahad

+2  A: 

Ok figure it out. Had to add sql server snapins to Runspace and it worked

 RSpace.RunspaceConfiguration.AddPSSnapIn("SqlServerCmdletSnapin100", out obj);
 RSpace.RunspaceConfiguration.AddPSSnapIn("SqlServerProviderSnapin100", out obj);
Fahad