powershell - 如何使用 PowerCli 获取 DataStore 的位置

标签 powershell vmware datastore powercli

使用Get-DataStore cmdlet 我们得到数据存储的名称为 Datasore1 。但我需要 ESX 上该数据存储的路径。类似于 /vmfs/volumes/<id>/ .

最佳答案

路径隐藏在 ExtensionData 属性内,因此将数据存储分配给变量:

$s = Get-Datastore Datasore1

然后提取路径:

$s.ExtensionData.info.url  

结果:

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

关于powershell - 如何使用 PowerCli 获取 DataStore 的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23238001/

相关文章:

python - Google Appengine 一对多并按 collection_name 查询

powershell - 从字节转换为千兆字节

Linux系统在VMware关闭前调用 "poweroff"后等待90秒

vagrant - 在 ESXi 上的 VMWare 虚拟机上运行的 Virtualbox

windows-7 - 路由表中的环回

python - 错误属性 %s 不是多行的

python - GAE 数据存储缓存键与过滤器

powershell - 尝试通过 Powershell 脚本在 IIS 中创建网站

c# - 使用 DirectorySearcher API 读取/处理大量数据

powershell - 从路径中删除最后一个扩展名