VMware vSphere

 View Only
  • 1.  How to get the VM files of its folder in datastore in powershell

    Posted Jul 11, 2018 09:38 AM

    Is there any scripts of powershell  to get the all file details of vm like vmx,vmdk,snapshots,log files and other files.



  • 2.  RE: How to get the VM files of its folder in datastore in powershell
    Best Answer

    Posted Jul 11, 2018 12:36 PM

    Play around with:

    dir -Recurse -Path datastore:\ -Include *vmname* | select Name,DatastoreFullPath

    Hope to help :smileyhappy:



  • 3.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 09:04 AM

    I got this error.  :smileyhappy:



  • 4.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 09:56 AM

    I think you can use RVTools for this to get the report



  • 5.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 11:10 AM

    Your datastore is named "datastore16" not "datastore" as in my example :smileyhappy:



  • 6.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 12:54 PM

    i got this output.

    it may be directing in the local machine.



  • 7.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 12:58 PM

    is there any way by this method.



  • 8.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 05:10 PM

    Superb aleex  

    Dir vmstores:\ip@portno\ha-datacenter\datastore16\  | select-object name

    I got the output what I expected from you.

    Thanks aleex. 



  • 9.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 11, 2018 01:39 PM

    What details are you looking for? Can you please elaborate? Do you want it in any specific format?

    Cheers,

    Supreet



  • 10.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 07:42 AM

    how to get these files in powershell.



  • 11.  RE: How to get the VM files of its folder in datastore in powershell

    Posted Jul 12, 2018 07:57 AM

    Try my example with "sles12sp3" instead of vmname :smileyhappy: