forked from atkinsroy/HPESimpliVity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHPESimpliVity.Host.Format.ps1xml
92 lines (92 loc) · 4.23 KB
/
HPESimpliVity.Host.Format.ps1xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<ViewDefinitions>
<View>
<Name>SvtHostTable</Name>
<ViewSelectedBy>
<TypeName>HPE.SimpliVity.Host</TypeName>
</ViewSelectedBy>
<TableControl>
<AutoSize />
<TableHeaders>
<TableColumnHeader>
<Label>HostName</Label>
<Width>40</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>DataCenterName</Label>
<Width>25</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>ClusterName</Label>
<Width>25</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>FreeSpaceGB</Label>
<Width>14</Width>
<Alignment>right</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>ManagementIP</Label>
<Width>16</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>StorageIP</Label>
<Width>16</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>FederationIP</Label>
<Width>16</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>HostName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>DataCenterName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ClusterName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<!--PropertyName>FreeSpaceGB</PropertyName-->
<ScriptBlock>
if ($host.name -match 'Console') {
$PercentUsed = 100 * (($_.AllocatedCapacityGB-$_.FreespaceGB) / $_.AllocatedCapacityGB)
switch ($PercentUsed) {
{$PSItem -gt 90 } {$ansi = "[38;5;9m"; break} #8bit red
{$PSItem -gt 80 } {$ansi = "[38;5;11m"; break} #8bit yellow
default { $ansi = "[38;5;10m"} #8bit green
}
"$([char]27)$ansi$($_.FreeSpaceGB)$([char]27)[0m"
}
else {
$_.FreespaceGB
}
</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ManagementIP</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>StorageIP</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>FederationIP</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>