Solved

Need a powercli command to list all contents of a datastore

Posted on 2013-01-27
1
1,220 Views
Last Modified: 2013-02-12
I need a powercli command that will list the contents of a datastore the same way you can choose "browse datastore" from the vsphere gui. In other words something that will list random folders that are not necessarily VMs.
0
Comment
Question by:Thaidog
1 Comment
 
LVL 118

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 500 total points
ID: 38824554
PowerCLI gives this ability based on the Powershell provider concept. This mean that VMware datastores can be browsed with the native Powershell commandlets like Set-Location, Get-Item, Get-ChildItem and their aliases like cd, ls, dir. PowerCLI datastore provider also allows to manipulate datastore contents with native Powershell commandlets like Copy-Item, Move-Item, Remove-Item, etc.

this example will list all files and subfolders that starts with WinXP
inside the datastore with name Storage1.

ls vmstores:\myServer@443\Datacenter\Storage1\WinXP*

Open in new window

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
A procedure for exporting installed hotfix details of remote computers using powershell
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now