public static Site add_Website(this API_IIS7 iis7, string websiteName, string serverRoot, int port) { if (iis7.hasWebsite(websiteName).isFalse()) { var site = iis7.serverManager.Sites.Add(websiteName, serverRoot, port); iis7.commitChanges(); if (site.notNull()) { "Created new website called {0} on port {1} at folder {2}".info(websiteName, serverRoot, port); } else { "Could not created website with the provided details".error(); return(null); } } else if (iis7.ShowErrorIfTryingToCreateAWebsiteThatAlreadyExists) { "Could not add site since it already existed a website with the same name: {0}".error(websiteName); } return(iis7.website(websiteName)); }
public static Configuration config(this API_IIS7 iis7, string siteName) { return(iis7.config(iis7.website(siteName))); }
public static bool hasWebsite(this API_IIS7 iis7, string name) { return(iis7.website(name).notNull()); }