I can create a new web application extension using New-SPWebApplicationExtension
but if it already exist I get an error with the message "The IIS Web Site you have selected is in use by SharePoint. You must select another port or hostname.".
I tried using Get-SPWebApplication
but it does not return the extensions. I know I could catch the thrown exception and react on it but I wonder if there is a more cleaver way, e.g. Get-SPWebApplicationExtension
that I can use to check if it already exist?