Solved

Need a powercli command to list all contents of a datastore

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
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.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
The viewer will learn how to dynamically set the form action using jQuery.

930 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

13 Experts available now in Live!

Get 1:1 Help Now