Today I tried to delete a SharePoint site (SPWeb) with child sites inside. I tried to delete it form administrator interface but I got an error. Something was wrong with templates or site structure. So I decided to use PowerShell for SharePoint.

I entered "Remove-SPWeb http://spdev/folder/" and pressed enter, but I got an error that this site has child sites and cannot be deleted.

So I decided to write a PowerShell script for removing: