Skip to content

Commit 98d8a2a

Browse files
committed
updates doc
1 parent 1580c4e commit 98d8a2a

File tree

2 files changed

+75
-10
lines changed

2 files changed

+75
-10
lines changed

docs/en-US/Get-PSTree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ PS ..\PSTree> Get-ChildItem -Directory | Get-PSTree -Include *.ps1
113113

114114
### -Depth
115115

116-
Determines the number of subdirectory levels that are included in the recursion.
116+
Determines the number of subdirectory levels that are included in the recursion. Default value is 3.
117117

118118
```yaml
119119
Type: Int32

docs/en-US/Get-PSTreeRegistry.md

Lines changed: 74 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,66 @@ The `Get-PSTreeRegistry` cmdlet provides a tree-style view of the Windows Regist
4141

4242
## EXAMPLES
4343

44-
### Example 1
44+
### Example 1: Display the `Software` registry hive with full recursion
4545

4646
```powershell
47-
PS C:\> {{ Add example code here }}
47+
PS ..\PSTree> Get-PSTreeRegistry HKLM:\Software -Recurse
4848
```
4949

50-
{{ Add example description here }}
50+
This example retrieves all keys under `HKLM:\Software`, showing the complete hierarchy recursively.
51+
52+
### Example 2: List only registry keys under `HKLM:\Software`, up to 2 levels deep, excluding values
53+
54+
```powershell
55+
PS ..\PSTree> Get-PSTreeRegistry HKLM:\Software -Depth 2 -KeysOnly
56+
```
57+
58+
This example restricts output to keys only (no values) and limits the depth to 2 levels for better readability.
59+
60+
### Example 3: Retrieve and Display a Value from a `TreeRegistryValue` Object
61+
62+
```powershell
63+
PS ..\PSTree> $items = Get-PSTreeRegistry HKCU:\Environment\ -Depth 2
64+
PS ..\PSTree> $values = $items | Where-Object { $_ -is [PSTree.TreeRegistryValue] }
65+
PS ..\PSTree> $values
66+
67+
Hive: HKEY_CURRENT_USER\Environment
68+
69+
Kind Hierarchy
70+
---- ---------
71+
ExpandString ├── Path
72+
ExpandString ├── TEMP
73+
ExpandString └── TMP
74+
75+
PS ..\PSTree> $values[1].GetValue()
76+
C:\Users\User\AppData\Local\Temp
77+
```
78+
79+
This example demonstrates how to use `Get-PSTreeRegistry` to retrieve registry values, filter for `TreeRegistryValue` objects, and access a specific value using the `.GetValue()` method. It targets the `HKCU:\Environment` hive, limiting depth to 2 levels, and shows how to extract a value like `TEMP`.
80+
81+
### Example 4: Traverse `HKEY_USERS` Using the Provider Path
82+
83+
```powershell
84+
PS ..\PSTree> Get-PSTreeRegistry -Path Registry::HKEY_USERS -Depth 1 -EA 0
85+
86+
Hive: HKEY_USERS
87+
88+
Kind Hierarchy
89+
---- ---------
90+
RegistryKey HKEY_USERS
91+
RegistryKey ├── S-1-5-18
92+
RegistryKey ├── S-1-5-21-3616279808-3400134814-4233402850-1002_Classes
93+
RegistryKey ├── S-1-5-21-3616279808-3400134814-4233402850-1002
94+
RegistryKey └── .DEFAULT
95+
```
96+
97+
This example uses the registry provider path to explore all keys under `HKEY_USERS`, limited to 1 level deep.
5198

5299
## PARAMETERS
53100

54101
### -Depth
55102

56-
Specifies the maximum depth of the registry traversal.
103+
Specifies the maximum depth of the registry traversal. Default value is 3.
57104

58105
```yaml
59106
Type: Int32
@@ -62,7 +109,7 @@ Aliases:
62109

63110
Required: False
64111
Position: Named
65-
Default value: None
112+
Default value: 3
66113
Accept pipeline input: False
67114
Accept wildcard characters: False
68115
```
@@ -123,7 +170,7 @@ Accept wildcard characters: True
123170

124171
### -Recurse
125172

126-
{{ Fill Recurse Description }}
173+
Enables recursive traversal of all subkeys under the specified registry path. Use this switch to ensure complete hierarchy exploration without depth restrictions.
127174

128175
```yaml
129176
Type: SwitchParameter
@@ -143,14 +190,32 @@ This cmdlet supports the common parameters. For more information, see [about_Com
143190

144191
## INPUTS
145192

146-
### String
193+
### System.String
194+
195+
You can pipe strings containing registry paths to this cmdlet.
196+
Output from `Get-Item` and `Get-ChildItem` can be piped to this cmdlet.
147197

148198
## OUTPUTS
149199

150-
### TreeRegistryKey
200+
### PSTree.TreeRegistryKey
201+
202+
Returns objects of type `TreeRegistryKey` representing registry keys in a hierarchical structure. If `-KeysOnly` is specified, only `TreeRegistryKey` objects are returned; otherwise, `TreeRegistryValue` objects may also be included, but the primary output type remains `TreeRegistryKey` for consistency with the tree-like organization.
151203

152-
### TreeRegistryValue
204+
### PSTree.TreeRegistryValue
205+
206+
Returns objects of type `TreeRegistryValue` representing registry values associated with keys, included in the output unless the `-KeysOnly` parameter is specified. Each object includes properties such as `Name`, `Kind`, and `Depth`, allowing access to value data (e.g., via the `.GetValue()` method). These objects are nested under `TreeRegistryKey` objects in the hierarchical output, providing detailed value information for registry exploration.
153207

154208
## NOTES
155209

210+
This cmdlet is Windows-only and requires PowerShell 5.1 or later. It may require elevated permissions for certain registry hives.
211+
156212
## RELATED LINKS
213+
214+
[**Microsoft.Win32 Namespace**](https://learn.microsoft.com/en-us/dotnet/api/microsoft.win32?view=net-9.0)
215+
216+
[**about_Registry_Provider**](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_registry_provider?view=powershell-7.5)
217+
218+
[**`Get-PSTreeRegistry` Source Code**](../../src/PSTree/Commands/GetPSTreeRegistryCommand.cs)
219+
220+
221+
[**`Get-PSTreeRegistry` Tests**](../../tests/GetPSTreeRegistryCommand.tests.ps1)

0 commit comments

Comments
 (0)