Skip to content

Commit 27cbb98

Browse files
authored
Merge pull request #50 from santisq/49-feature---get-pstree---alias-for-recursivesize-parameter
Adds parameter aliases for `Get-PSTree` and `Get-PSTreeRegistry` commands.
2 parents c776a8f + 4c663aa commit 27cbb98

File tree

8 files changed

+27
-15
lines changed

8 files changed

+27
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
- __04/19/2025__
4+
- Adds parameter aliases for `Get-PSTree` and `Get-PSTreeRegistry`, issue #49.
5+
36
- __04/07/2025__
47
- Modifies the `Get-PSTreeRegistry` cmdlet to include registry default values (unnamed values displayed as `(Default)` in regedit), which were previously excluded due to a filter on empty value names.
58

docs/en-US/Get-PSTree.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Specifies the maximum depth of the folder traversal. The default value is 3, lim
128128
```yaml
129129
Type: Int32
130130
Parameter Sets: (All)
131-
Aliases:
131+
Aliases: p, dp
132132

133133
Required: False
134134
Position: Named
@@ -144,7 +144,7 @@ Limits output to directories only, excluding files. When specified, the cmdlet d
144144
```yaml
145145
Type: SwitchParameter
146146
Parameter Sets: (All)
147-
Aliases:
147+
Aliases: d, dir
148148
149149
Required: False
150150
Position: Named
@@ -165,7 +165,7 @@ Specifies an array of one or more string patterns to exclude items from the outp
165165
```yaml
166166
Type: String[]
167167
Parameter Sets: (All)
168-
Aliases:
168+
Aliases: exc
169169
170170
Required: False
171171
Position: Named
@@ -181,7 +181,7 @@ Allows the cmdlet to access items that would otherwise be inaccessible, such as
181181
```yaml
182182
Type: SwitchParameter
183183
Parameter Sets: (All)
184-
Aliases:
184+
Aliases: f
185185
186186
Required: False
187187
Position: Named
@@ -203,7 +203,7 @@ Specifies an array of one or more string patterns to include only matching items
203203
```yaml
204204
Type: String[]
205205
Parameter Sets: (All)
206-
Aliases:
206+
Aliases: inc
207207
208208
Required: False
209209
Position: Named
@@ -251,7 +251,7 @@ Enables recursive traversal of all subfolders under the specified path. Use this
251251
```yaml
252252
Type: SwitchParameter
253253
Parameter Sets: (All)
254-
Aliases:
254+
Aliases: r, rec
255255
256256
Required: False
257257
Position: Named
@@ -269,7 +269,7 @@ By default, hidden and system items are excluded from recursive size calculation
269269
```yaml
270270
Type: SwitchParameter
271271
Parameter Sets: (All)
272-
Aliases:
272+
Aliases: rs
273273
274274
Required: False
275275
Position: Named

docs/en-US/Get-PSTreeRegistry.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Specifies the maximum depth of the registry traversal. Default value is 3. Use t
121121
```yaml
122122
Type: Int32
123123
Parameter Sets: (All)
124-
Aliases:
124+
Aliases: p, dp
125125

126126
Required: False
127127
Position: Named
@@ -137,7 +137,7 @@ Limits output to `TreeRegistryKey` objects only, excluding `TreeRegistryValue` o
137137
```yaml
138138
Type: SwitchParameter
139139
Parameter Sets: (All)
140-
Aliases:
140+
Aliases: k, key
141141
142142
Required: False
143143
Position: Named
@@ -191,7 +191,7 @@ Enables recursive traversal of all subkeys under the specified registry path. Us
191191
```yaml
192192
Type: SwitchParameter
193193
Parameter Sets: (All)
194-
Aliases:
194+
Aliases: r, rec
195195
196196
Required: False
197197
Position: Named
@@ -213,7 +213,7 @@ Specifies an array of one or more string patterns to exclude registry keys or va
213213
```yaml
214214
Type: String[]
215215
Parameter Sets: (All)
216-
Aliases:
216+
Aliases: exc
217217
218218
Required: False
219219
Position: Named
@@ -235,7 +235,7 @@ Specifies an array of one or more string patterns to include only matching regis
235235
```yaml
236236
Type: String[]
237237
Parameter Sets: (All)
238-
Aliases:
238+
Aliases: inc
239239
240240
Required: False
241241
Position: Named

module/PSTree.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
# Version number of this module.
19-
ModuleVersion = '2.2.5'
19+
ModuleVersion = '2.2.6'
2020

2121
# Supported PSEditions
2222
# CompatiblePSEditions = @()

src/PSTree/Commands/GetPSTreeCommand.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4-
using System.Linq;
54
using System.Management.Automation;
65
using Microsoft.PowerShell.Commands;
76
using PSTree.Extensions;
@@ -20,12 +19,15 @@ public sealed class GetPSTreeCommand : TreeCommandBase
2019
private readonly TreeComparer _comparer = new();
2120

2221
[Parameter]
22+
[Alias("f")]
2323
public SwitchParameter Force { get; set; }
2424

2525
[Parameter]
26+
[Alias("dir", "d")]
2627
public SwitchParameter Directory { get; set; }
2728

2829
[Parameter]
30+
[Alias("rs")]
2931
public SwitchParameter RecursiveSize { get; set; }
3032

3133
protected override void ProcessRecord()

src/PSTree/Commands/GetPSTreeRegistryCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public sealed class GetPSTreeRegistryCommand : TreeCommandBase
2424
#endif
2525

2626
[Parameter]
27+
[Alias("k", "key")]
2728
public SwitchParameter KeysOnly { get; set; }
2829

2930
protected override void BeginProcessing()

src/PSTree/Extensions/TreeExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Runtime.CompilerServices;
43
using System.Text;
54
using Microsoft.Win32;
5+
#if NETCOREAPP
6+
using System.Runtime.CompilerServices;
7+
#endif
68

79
namespace PSTree.Extensions;
810

src/PSTree/TreeCommandBase.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,23 @@ public virtual string[]? LiteralPath
5555

5656
[Parameter]
5757
[ValidateRange(0, int.MaxValue)]
58+
[Alias("p", "dp")]
5859
public virtual int Depth { get; set; } = 3;
5960

6061
[Parameter]
62+
[Alias("rec", "r")]
6163
public SwitchParameter Recurse { get; set; }
6264

6365
[Parameter]
6466
[SupportsWildcards]
6567
[ValidateNotNullOrEmpty]
68+
[Alias("exc")]
6669
public string[]? Exclude { get; set; }
6770

6871
[Parameter]
6972
[SupportsWildcards]
7073
[ValidateNotNullOrEmpty]
74+
[Alias("inc")]
7175
public string[]? Include { get; set; }
7276

7377
protected override void BeginProcessing()

0 commit comments

Comments
 (0)