VMware Cloud Community
tdubb123
Expert
Expert

listing contents in a datastore

any idea how i can show the contents inside a datastore?

1 Reply
LucD
Leadership
Leadership

Yes, with the VimDatastore drive

$dsName = 'ds1'

$ds = Get-Datastore -Name $dsName

New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root '\'

Get-ChildItem -Path DS:\ -Recurse | Select DatastoreFullPath,ItemType

Remove-PSDrive -Name DS -Confirm:$false


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference