PowerShell script for IIS installation

PowerShells script for automated installation on Windows and IIS

(please see this page for basic installation for .net core on Windows MDrivenServerCore in IIS)

Please consider this for web sites on IIS.

  • "Site" is the name of the website, which also points to the physical path on the server
    • A Site holds information on "bindings", which is the same as which protocols and certificates that should be used.
  • A subfolder of a site usually looks like a "subsite" of that Site, for example of the "Default Web Site"
    • "Subsite" doesn't really exist, but is a subfolder of a Site. Still it can have application information assigned to it.
  • "Application" is information that points a folder of site to an AppPool
  • "AppPool" is the settings for the process that will process requests of the Site and Application
  • An application can be hosted in the site root, or in subfolders, i.e. subsites


NOTE! The certificate MUST be valid for the MDrivenServer to start. A MDrivenServer talks to itself and needs to be able to accept it's own certificate.

Having the above in mind, this is the parameters to the script;

This script has the following parameters;

  • appName The name of the Site
  • appURL The public URL that clients access this site, must be provided
  • certFriendlyName The friendly name of the certificate that the script will try to attach to the site binding.
  • appInOwnSite Default is $false $false puts the app as subsite to the app with $siteName. $true uses a siteName the same as the app name for each app
  • appInSiteRoot Default to $false, which means that a subfolder will be created in the Site folder
  • siteName  Default to the default site of a standard installed IIS, "Default Web Site"
  • inetpubPath Default to "%SystemDrive%\inetpub", and you usually don't need to provide this
  • cleanSite Default to $false, which will leave existing files in the site folder. $true will delete all files except settings and database files.
  • $updateFile If provided, updates the site from this zip-file. If only file name (without path), the current users Download folder will be used to find the file.
This page was edited 3 days ago on 04/29/2024. What links here