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-SPSite doesn't have a -Recycle parameter, so the site collection doesn't go to the Recycle Bin.
Remove-SPWeb has 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.
This has more to do with the differences between sites and site collections. Site Collections do not go the the site collection recycle bin. That would be impossible since you cannot put a site into its own recycle bin. There is what is known as "Deleted sites", if that is what you are looking for, please see here.
Remove-SPSiteit doesn't appear on the Recycle Bin with