Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Need a powercli command to list all contents of a datastore

Posted on 2013-01-27
1
1,443 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 119

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

860 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