I've written a powershell script to create a web application, add libraries and pages, etc. As I work through the script and fix bugs and issues, I delete the web application through central administration and restart IIS.
When I run the script again, it always throws me the following error and after restarting IIS again, the script runs fine.
`http://SharePointApp:280` is already routed to the Default zone of another application. Remove that mapping or use a different URL
I tried to restart IIS a couple of times before running the script but that doesn't help either. Its just a little annoying to see this problem when I clearly restart IIS to remove any references of the deleted web application before running the script and have to do it again for some weird problem.
Has anyone seen this behaviour? How do I fix it?