public static bool RestartPool(this ICakeContext context, string server, string name) { using (ServerManager manager = BaseManager.Connect(server)) { ApplicationPoolManager poolManager = ApplicationPoolManager.Using(context.Environment, context.Log, manager); if (poolManager.Stop(name)) { return(poolManager.Start(name)); } else { return(false); } } }
public static bool RestartSite(this ICakeContext context, string server, string name) { using (ServerManager manager = BaseManager.Connect(server)) { WebsiteManager webManager = WebsiteManager.Using(context.Environment, context.Log, manager); if (webManager.Stop(name)) { return(webManager.Start(name)); } else { return(false); } } }
/// <summary> /// Set the IIS ServerManager /// </summary> /// <param name="server">The name of the server to connect to.</param> public void SetServer(string server) { this.SetServer(BaseManager.Connect(server)); }
/// <summary> /// Set the IIS ServerManager /// </summary> public void SetServer() { this.SetServer(BaseManager.Connect("")); }