Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

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

View solution in original post

Reply
0 Kudos