PowerShell script for IIS installation
This page was created by Lars.olofsson@mdriven.net on 2024-04-13. Last edited by Edgar on 2025-01-20.

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
  • "Application" is the information in the Site that points to the AppPool
  • "AppPool" is the settings for the process that will process requests of the Site and Application
  • A Site can


This script has the following parameters;

$appName The name of the Site and AppPool, if no Site name is provided

[string]$appURL  = "test.kvadrat.se",

    [string]$certFriendlyName = "*.kvadrat.se",

[boolean]$appInOwnSite = $False,   # $false puts the app as a app with $siteName. $true uses a siteName the same as the app name for each app

[boolean]$appInSiteRoot = $False,

[string]$siteName  = "Default Web Site",

[string]$inetpubPath = "%SystemDrive%\inetpub",

[boolean]$cleanSite = $false,