简体   繁体   中英

How to get DataStore's location using PowerCli

Using Get-DataStore cmdlet we get the name of datastore as Datasore1 . But I need path of that datastore on ESX. Which is something like /vmfs/volumes/<id>/ .

The path is hidden inside ExtensionData property, so assign your datastore to a variable:

$s = Get-Datastore Datasore1

and then extract the path:

$s.ExtensionData.info.url  

result:

/vmfs/volumes/50cb7918-d31a7b14-f5a7-d89d676e15pl

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM