- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
$fileMgr.DeleteDatastoreFile($file, $dc.ExtensionData.MoRef)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference