how do I delete a bunch of empty folders inside a lun?
the are named identical
test-*
get-datastore -name "lun 28" | ....
I would go for the Datastore provider. Something like this perhaps.
$DS = Get-Datastore -Name "lun 28" New-PSDrive -Name MyDS -Location $DS -PSProvider VimDatastore -Root '\' | Out-NullGet-ChildItem -Path MyDS: -Recurse | Where {$_.Name -like "test-*"} | Remove-Item -Confirm:$falseRemove-PSDrive -Name MyDS
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference