Scenario/Problem: You need to remove a deleted site collection from your SharePoint farm.
Solution: Use the Remove-SPDeletedSite
cmdlet with a site collection variable.
The Remove-SPDeletedSite
cmdlet enables you to remove a specific site collection from the current server. Use this in conjunction with the Get-SPDeletedSite
cmdlet (explained in a previous section), as shown in Listing 8.21, or just use the site collection identity directly in line, as shown in Listing 8.22.
$deletedSiteCol = Get-SPDeletedSite -Identity "/ sites/ deletedsitecol "
Remove-SPDeletedSite $deletedSiteCol
Remove-SPDeletedSite -Identity " /sites/deletedsitecol"
3.21.103.209