Quickly Remove ALL Webs under a Site Collection Using PowerShell


I was cleaning up my demo site collection, and I needed to remove all subwebs… Here’s a quick one-liner of PowerShell to do exactly that.

Get-SPSite <SiteUrl> | Get-SPWeb -Limit All | ForEach-Object {Remove-SPWeb -Identity $_ -Confirm:$false}
</ShortestPostEver>