我正在准备一个 powershell 脚本,用于将 unity 容量池详细信息导出到 csv 文件。需要一个循环将所有池详细信息导出到 csv 文件。循环应从以下输出中读取已用空间和总空间。需要在 csv 文件中复制两行两个池详细信息,其中包含池名称和相应的已用空间和剩余空间和整体空间有人能帮忙吗
1: ID = pool_1
Name = test POOL
Total space = 15726559625216 (14.3T)
Remaining space = 5425885872128 (4.9T)
Subscription percent = 148%
Number of drives = 25
RAID level = 5
Stripe length = 5
Rebalancing = no
Health state = OK (5)
FAST Cache enabled = no
Protection size used = 0
Non-base size used = 0
2: ID = pool_4
Name = music Pool
Total space = 42507291328512 (38.6T)
Remaining space = 22079084691456 (20.0T)
Subscription percent = 351%
Number of drives = 45
RAID level = 5
Stripe length = 5
Rebalancing = no
Health state = OK (5)
FAST Cache enabled = no
Protection size used = 225889239040 (210.3G)
Non-base size used = 225889239040 (210.3G)
#脚本
$names = @(
"test.unity.com"
# ...
)
$arrays = @()
foreach ($name in $names) {
#$system=uemcli -d 10.1.1.1 -u Local/admin -p password1/sys/general show
#echo $system
$arrays1 = uemcli -d $name -u Local/admin -p password! /stor/config/pool show
echo $arrays1
$name=($arrays1| Select-Object -Property Name )
echo $hostname1
}