VMware Cloud Community
airaqi
Enthusiast
Enthusiast

Get files list from a specific datastore

Hi all,

How i can get a list of the VMX files from a specific datastore?

 

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

Something like this for example

$dsName = 'MyDS'
$ds = Get-Datastore -Name $dsName

New-PSDrive -Name DS -Location $ds -PSProvider VimDatastore -Root '\' | Out-Null
Get-ChildItem -Path DS: -Filter '*.vmx' -Recurse | select Name,FolderPath
Remove-PSDrive -Name DS


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

aakibdawood
Enthusiast
Enthusiast

Or you can:

1. SSH into one of the ESXi hosts

2. Change directory into the datastore under /vmfs/volumes/<name of the datastore>

3. use "find" to search for all VMX files. Check the screenshot.

Reply
0 Kudos
LucD
Leadership
Leadership

Really?!?
A manual procedure in a community listed under Automation


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

Reply
0 Kudos
aakibdawood
Enthusiast
Enthusiast

Didnt mean to offend anyone. Just wanted to give him the options.
BTW i am new so mistakes happen.