-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenXdevCmdletInfo.format.ps1xml
More file actions
128 lines (123 loc) · 5.8 KB
/
Copy pathGenXdevCmdletInfo.format.ps1xml
File metadata and controls
128 lines (123 loc) · 5.8 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<ViewDefinitions>
<!-- GenXdevCmdletInfo: Table View -->
<View>
<Name>GenXdevCmdletInfo-Table</Name>
<ViewSelectedBy>
<TypeName>GenXdev.Helpers.GenXdevCmdletInfo</TypeName>
</ViewSelectedBy>
<TableControl>
<AutoSize />
<TableHeaders>
<TableColumnHeader>
<Label>Name</Label>
<Width>20</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Description</Label>
<Width>40</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<Wrap />
<TableColumnItems>
<TableColumnItem>
<ScriptBlock>
$ansiColorWhite = "$([char]27)[0;37m"
$ansiColorGrey = "$([char]27)[0;90m"
$ansiColorCyan = "$([char]27)[0;36m"
$ansiColorReset = "$([char]27)[0m"
$s = "$ansiColorGrey$($_.BaseModule)\$ansiColorWhite$($_.Name)$ansiColorReset"
if (-not [string]::IsNullOrWhiteSpace($_.Aliases)) {
$s = "$ansiColorGrey$($_.BaseModule)\$ansiColorWhite$($_.Name)$ansiColorGrey --> $ansiColorCyan$($_.Aliases)$ansiColorReset"
}
$s
</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
$ansiColorWhite = "$([char]27)[0;37m"
$ansiColorGrey = "$([char]27)[0;90m"
$ansiColorCyan = "$([char]27)[0;36m"
$ansiColorReset = "$([char]27)[0m"
$Global:_GenXdevCmdletInfoOddEven = if ($Global:_GenXdevCmdletInfoOddEven) { $false } else { $true }
$ansiColor = if ($Global:_GenXdevCmdletInfoOddEven) { $ansiColorWhite } else { $ansiColorGrey }
if ([string]::IsNullOrWhiteSpace($_.Description)) {
"${ansiColorCyan}No description found$ansiColorReset"
}
else {
"$ansiColor$($_.Description)$ansiColorReset"
}
</ScriptBlock>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!-- GenXdevCmdletInfo: List View -->
<View>
<Name>GenXdevCmdletInfo-List</Name>
<ViewSelectedBy>
<TypeName>GenXdev.Helpers.GenXdevCmdletInfo</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<Label>Name</Label>
<PropertyName>Name</PropertyName>
</ListItem>
<ListItem>
<Label>Module Name</Label>
<PropertyName>ModuleName</PropertyName>
</ListItem>
<ListItem>
<Label>Base Module</Label>
<PropertyName>BaseModule</PropertyName>
</ListItem>
<ListItem>
<Label>Line Number</Label>
<PropertyName>LineNo</PropertyName>
</ListItem>
<ListItem>
<Label>Description</Label>
<PropertyName>Description</PropertyName>
</ListItem>
<ListItem>
<Label>Aliases</Label>
<PropertyName>Aliases</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
<!-- GenXdevCmdletInfo: Wide View -->
<View>
<Name>GenXdevCmdletInfo-Wide</Name>
<ViewSelectedBy>
<TypeName>GenXdev.Helpers.GenXdevCmdletInfo</TypeName>
</ViewSelectedBy>
<WideControl>
<WideEntries>
<WideEntry>
<WideItem>
<ScriptBlock>
$name = $_.Name
$ModuleObj = if ($_.ModuleName) { $_.ModuleName } else { $_.BaseModule }
$aliases = if ($_.Aliases) { " [$($_.Aliases)]" } else { "" }
"${name} (${moduleObj})${aliases}"
</ScriptBlock>
</WideItem>
</WideEntry>
</WideEntries>
</WideControl>
</View>
</ViewDefinitions>
</Configuration>