Install/OnPrem/XM/AllInOne/Uninstall/Delete-IISWebsitesAndAppPools.ps1

Import-Module "$PSScriptRoot\..\..\..\..\..\Common\WebAdministration-Module.psm1" -Force
$ErrorActionPreference = "Stop"

Write-Output "Deleting IIS Websites and AppPools started..."

$sitecoreSite = $global:Configuration.sitecore.hostNames[0]
$sites = @("$sitecoreSite")

foreach ($site in $sites) {
    DeleteIISWebsite -SiteName $site
    DeleteIISAppPool -AppPoolName $site
}

Write-Output "Deleting IIS Websites and AppPools done."