I have a PowerShell script that creates a web application using New-SPWebApplication. It crashed for some reason a while back and now it keeps telling me the application pool exists. I've looked in IIS, in SharePoint Central Administration -> Web Applications and using PowerShell Get-SPServiceApplicationPool, but cannot find it anywhere. It seems that SharePoint has convinced itself the application pool is present, but I'm unable to remove it and start over.
Is there a way to persuade SharePoint that the application pool does not in fact exist so I can recreate the web application?