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);
                }
            }
        }
Exemple #2
0
        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);
                }
            }
        }
Exemple #3
0
 /// <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));
 }
Exemple #4
0
 /// <summary>
 /// Set the IIS ServerManager
 /// </summary>
 public void SetServer()
 {
     this.SetServer(BaseManager.Connect(""));
 }