You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+76-2Lines changed: 76 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,79 @@
1
1
# CHANGELOG
2
2
3
+
-__01/19/2025__
4
+
- Big code refactoring, this update improves readability and simplicity.
5
+
- Updates to `-Include` and `-Exclude` parameters, with this update the patterns are evaluated using the
6
+
object's `.Name` property instead of `.FullName`.
7
+
- In addition to the above, this update improves how the cmdlet displays trees when `-Include` is used.
8
+
Before, the cmdlet would display trees where no file was matched by the include patterns. Now, only trees having files matched by the include patterns are displayed.
Copy file name to clipboardExpand all lines: docs/en-US/Get-PSTree.md
+21-14Lines changed: 21 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ schema: 2.0.0
18
18
```powershell
19
19
Get-PSTree
20
20
[[-Path] <String[]>]
21
-
[-Depth <UInt32>]
21
+
[-Depth <Int32>]
22
22
[-Recurse]
23
23
[-Force]
24
24
[-Directory]
@@ -33,7 +33,7 @@ Get-PSTree
33
33
```powershell
34
34
Get-PSTree
35
35
[-LiteralPath <String[]>]
36
-
[-Depth <UInt32>]
36
+
[-Depth <Int32>]
37
37
[-Recurse]
38
38
[-Force]
39
39
[-Directory]
@@ -71,7 +71,8 @@ In this example `$HOME` is bound positionally to the `-Path` parameter.
71
71
PS ..\PSTree> Get-PSTree -Depth 2 -Force
72
72
```
73
73
74
-
The `-Force` switch is needed to display hidden files and folders. In addition, hidden child items do not add up to the folders size without this switch.
74
+
> [!TIP]
75
+
> The `-Force` switch is needed to display hidden files and folders. In addition, hidden child items do not add up to the folders size without this switch.
75
76
76
77
### Example 4: Get the `C:\` drive tree 2 levels in depth displaying only folders calculating the recursive size
The `-Exclude` parameter supports [wildcard patterns](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_wildcards?view=powershell-7.3), exclusion patterns are tested against the items `.FullName` property. Excluded items do not do not add to the folders size.
89
+
> [!NOTE]
90
+
>
91
+
> - The `-Exclude` parameter supports [wildcard patterns](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_wildcards?view=powershell-7.3), exclusion patterns are evaluated using the items `.Name` property.
92
+
> -__Excluded items do not do not add to the folders size.__
89
93
90
94
### Example 6: Get the tree of all folders in a location
Similar to `-Exclude`, the `-Include` parameter supports [wildcard patterns](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_wildcards?view=powershell-7.3), however, __this parameter works only with Files__.
109
+
> [!IMPORTANT]
110
+
> Similar to `-Exclude`, the `-Include` parameter supports [wildcard patterns](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_wildcards?view=powershell-7.3), however, __this parameter works only with Files__.
105
111
106
112
## PARAMETERS
107
113
@@ -110,7 +116,7 @@ Similar to `-Exclude`, the `-Include` parameter supports [wildcard patterns](htt
110
116
Determines the number of subdirectory levels that are included in the recursion.
111
117
112
118
```yaml
113
-
Type: UInt32
119
+
Type: Int32
114
120
Parameter Sets: (All)
115
121
Aliases:
116
122
@@ -147,8 +153,8 @@ Excluded items do not add to the recursive folders size.
147
153
148
154
> [!NOTE]
149
155
>
150
-
> - Patterns are tested against the object's `.FullName` property.
151
-
> - The `-Include` and `-Exclude` parameters can be used together and the inclusions are applied after the exclusions.
156
+
> - Patterns are evaluated using the object's `.Name` property.
157
+
> - The `-Include` and `-Exclude` parameters can be used together, however the exclusions are applied before the inclusions.
152
158
153
159
```yaml
154
160
Type: String[]
@@ -186,9 +192,9 @@ Wildcard characters are accepted.
186
192
187
193
> [!NOTE]
188
194
>
189
-
> - Patterns are tested against the object's `.FullName` property.
190
-
> - This parameter focuses only on files, the inclusion patterns are only evaluated against `FileInfo` instances.
191
-
> - The `-Include` and `-Exclude` parameters can be used together and the inclusions are applied after the exclusions.
195
+
> - __This parameter works only on files.__
196
+
> - Patterns are evaluated using the object's `.Name` property.
197
+
> - The `-Include` and `-Exclude` parameters can be used together, however the exclusions are applied before the inclusions.
0 commit comments