This post explains how you can run a (SharePoint) Powershell command from C#/SharePoint.
Posted On Wednesday, September 19, 2012 1:17 PM