Powershell

Automate IIS Sites with PowerShell

Converting an IIS virtual directory to web application requires a number of steps. If tens or hundreds of sites are involved and done manually, this can be a tedious, error prone and time-consuming endeavor. Luckily, PowerShell can automate those tasks with relative ease :-). Import-Module WebAdministration foreach ($appName in Get-Content .\SitesList.txt) { Write-Host $appName -fore green; # $appName = "MyApp" $appPoolName = "AppPool_$appName" $sitePath = "example.com" $folderPath = "C:\inetpub\example.com\$appName" $iisPath = "IIS:\Sites\example.