On SharePoint 2013 I'm trying to delete a site collection programmatically and send it to the Recycle Bin. Through the interface is no problem, it goes straight to the Recycle Bin, but when it comes to PowerShell,
Remove-SPSitedoesn't have a
-Recycleparameter, so the site collection doesn't go to the Recycle Bin.
Remove-SPWebhas this parameter, but this cmdlet doesn't let me use it because
Cannot put top-level site into Recycle Bin.
What am I doing wrong? Is there any way to achieve this?
Edit: I forgot to say that a C# solution is also valid, even preferable.