You need the FileManager for that.
Try like this, it will delete the folder and all its content.$file = '[MyDS] TestFolder'
$dcName = 'MyDC'
$dc = Get-Datacenter -Name $dcName
$si = Get-View ServiceInstance
$fileMgr = Get-View -Id $si.Content.FileManager
is there any script to Delete the Empty folders in Data stores.
This will also delete an empty folder.
Great, please need a script to delete the ONLY empty folders in Datastore. we don't want touch any other folders.