Skip to content

Commit a9a3adc

Browse files
Fixes #10898 - Add note about AdditionalChildPath parameter (#10901)
* Add note about AdditionalChildPath parameter * Apply suggestions from review --------- Co-authored-by: Mikey Lombardi (He/Him) <[email protected]>
1 parent 1ad25ce commit a9a3adc

File tree

5 files changed

+172
-123
lines changed

5 files changed

+172
-123
lines changed

reference/5.1/Microsoft.PowerShell.Management/Join-Path.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 06/09/2017
5+
ms.date: 02/26/2024
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/join-path?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Join-Path
@@ -38,7 +38,8 @@ path\childpath
3838

3939
This command uses `Join-Path` to combine a path with a childpath.
4040

41-
Since the command is executed from the `FileSystem` provider, it provides the `\` delimiter to join the paths.
41+
Since the command is executed from the `FileSystem` provider, it provides the `\` delimiter to join
42+
the paths.
4243

4344
### Example 2: Combine paths that already contain directory separators
4445

@@ -50,17 +51,19 @@ PS C:\> Join-Path -Path "path\" -ChildPath "\childpath"
5051
path\childpath
5152
```
5253

53-
Existing directory separators `\` and handled so there is only one separator between `Path` and `ChildPath`
54+
Existing directory separators `\` are handled so there is only one separator between `Path` and
55+
`ChildPath`
5456

5557
### Example 3: Display files and folders by joining a path with a child path
5658

5759
```powershell
5860
Join-Path "C:\win*" "System*" -Resolve
5961
```
6062

61-
This command displays the files and folders that are referenced by joining the C:\Win\* path and the System\* child path.
62-
It displays the same files and folders as `Get-ChildItem`, but it displays the fully qualified path to each item.
63-
In this command, the `Path` and `ChildPath` optional parameter names are omitted.
63+
This command displays the files and folders that are referenced by joining the `C:\Win\*` path and
64+
the `System\*` child path. It displays the same files and folders as `Get-ChildItem`, but it
65+
displays the fully qualified path to each item. In this command, the `Path` and `ChildPath` optional
66+
parameter names are omitted.
6467

6568
### Example 4: Use Join-Path with the PowerShell registry provider
6669

@@ -73,9 +76,11 @@ HKLM:\System\ControlSet001
7376
HKLM:\System\CurrentControlSet
7477
```
7578

76-
This command displays the registry keys in the `HKLM\System` registry subkey that include `ControlSet`.
79+
This command displays the registry keys in the `HKLM\System` registry subkey that include
80+
`ControlSet`.
7781

78-
The `Resolve` parameter, attempts to resolve the joined path, including wildcards from the current provider path `HKLM:\`
82+
The `Resolve` parameter, attempts to resolve the joined path, including wildcards from the current
83+
provider path `HKLM:\`
7984

8085
### Example 5: Combine multiple path roots with a child path
8186

@@ -106,20 +111,22 @@ C:\Subdir
106111
D:\Subdir
107112
```
108113

109-
This command combines the roots of each PowerShell file system drive in the console with the Subdir child path.
114+
This command combines the roots of each PowerShell file system drive in the console with the `Subdir`
115+
child path.
110116

111-
The command uses the `Get-PSDrive` cmdlet to get the PowerShell drives supported by the FileSystem provider.
112-
The `ForEach-Object` statement selects only the Root property of the `PSDriveInfo` objects and combines it with the specified child path.
117+
The command uses the `Get-PSDrive` cmdlet to get the PowerShell drives supported by the FileSystem
118+
provider. The `ForEach-Object` statement selects only the **Root** property of the **PSDriveInfo**
119+
objects and combines it with the specified child path.
113120

114-
The output shows that the PowerShell drives on the computer included a drive mapped to the C:\Program Files directory.
121+
The output shows that the PowerShell drives on the computer included a drive mapped to the
122+
`C:\Program Files` directory.
115123

116124
## PARAMETERS
117125

118126
### -ChildPath
119127

120-
Specifies the elements to append to the value of the `Path` parameter.
121-
Wildcards are permitted.
122-
The `ChildPath` parameter is required, although the parameter name ("ChildPath") is optional.
128+
Specifies the elements to append to the value of the `Path` parameter. Wildcards are permitted. The
129+
`ChildPath` parameter is required, although the parameter name ("ChildPath") is optional.
123130

124131
```yaml
125132
Type: System.String
@@ -211,7 +218,10 @@ Accept wildcard characters: False
211218

212219
### CommonParameters
213220

214-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
221+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
222+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
223+
-WarningAction, and -WarningVariable. For more information, see
224+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
215225

216226
## INPUTS
217227

@@ -227,18 +237,17 @@ This cmdlet returns a string that contains the resulting path.
227237

228238
## NOTES
229239

230-
The cmdlets that contain the Path noun (the Path cmdlets) manipulate path names and return the
231-
names in a concise format that all PowerShell providers can interpret. They are designed for
232-
use in programs and scripts where you want to display all or part of a path name in a
233-
particular format. Use them like you would use Dirname, Normpath, Realpath, Join, or other path
234-
manipulators.
240+
The cmdlets that contain the Path noun (the Path cmdlets) manipulate path names and return the names
241+
in a concise format that all PowerShell providers can interpret. They are designed for use in
242+
programs and scripts where you want to display all or part of a path name in a particular format.
243+
Use them like you would use `Dirname`, `Normpath`, `Realpath`, `Join`, or other path manipulators.
235244

236245
You can use the path cmdlets with several providers, including the `FileSystem`, `Registry`, and
237246
`Certificate` providers.
238247

239-
This cmdlet is designed to work with the data exposed by any provider.
240-
To list the providers available in your session, type `Get-PSProvider`.
241-
For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
248+
This cmdlet is designed to work with the data exposed by any provider. To list the providers
249+
available in your session, type `Get-PSProvider`. For more information, see
250+
[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
242251

243252
## RELATED LINKS
244253

reference/7.2/Microsoft.PowerShell.Management/Join-Path.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 06/09/2017
5+
ms.date: 02/26/2024
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/join-path?view=powershell-7.2&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Join-Path
@@ -39,6 +39,7 @@ path\childpath
3939
This command uses `Join-Path` to combine a path with a childpath.
4040

4141
Since the command is executed from the `FileSystem` provider, it provides the `\` delimiter to join the paths.
42+
the paths.
4243

4344
### Example 2: Combine paths that already contain directory separators
4445

@@ -50,17 +51,19 @@ PS C:\> Join-Path -Path "path\" -ChildPath "\childpath"
5051
path\childpath
5152
```
5253

53-
Existing directory separators `\` and handled so there is only one separator between `Path` and `ChildPath`
54+
Existing directory separators `\` are handled so there is only one separator between `Path` and
55+
`ChildPath`
5456

5557
### Example 3: Display files and folders by joining a path with a child path
5658

5759
```powershell
5860
Join-Path "C:\win*" "System*" -Resolve
5961
```
6062

61-
This command displays the files and folders that are referenced by joining the C:\Win\* path and the System\* child path.
62-
It displays the same files and folders as `Get-ChildItem`, but it displays the fully qualified path to each item.
63-
In this command, the `Path` and `ChildPath` optional parameter names are omitted.
63+
This command displays the files and folders that are referenced by joining the `C:\Win\*` path and
64+
the `System\*` child path. It displays the same files and folders as `Get-ChildItem`, but it
65+
displays the fully qualified path to each item. In this command, the `Path` and `ChildPath` optional
66+
parameter names are omitted.
6467

6568
### Example 4: Use Join-Path with the PowerShell registry provider
6669

@@ -73,9 +76,11 @@ HKLM:\System\ControlSet001
7376
HKLM:\System\CurrentControlSet
7477
```
7578

76-
This command displays the registry keys in the `HKLM\System` registry subkey that include `ControlSet`.
79+
This command displays the registry keys in the `HKLM\System` registry subkey that include
80+
`ControlSet`.
7781

78-
The `Resolve` parameter, attempts to resolve the joined path, including wildcards from the current provider path `HKLM:\`
82+
The `Resolve` parameter, attempts to resolve the joined path, including wildcards from the current
83+
provider path `HKLM:\`
7984

8085
### Example 5: Combine multiple path roots with a child path
8186

@@ -106,12 +111,15 @@ C:\Subdir
106111
D:\Subdir
107112
```
108113

109-
This command combines the roots of each PowerShell file system drive in the console with the Subdir child path.
114+
This command combines the roots of each PowerShell file system drive in the console with the `Subdir`
115+
child path.
110116

111-
The command uses the `Get-PSDrive` cmdlet to get the PowerShell drives supported by the FileSystem provider.
112-
The `ForEach-Object` statement selects only the Root property of the `PSDriveInfo` objects and combines it with the specified child path.
117+
The command uses the `Get-PSDrive` cmdlet to get the PowerShell drives supported by the FileSystem
118+
provider. The `ForEach-Object` statement selects only the **Root** property of the **PSDriveInfo**
119+
objects and combines it with the specified child path.
113120

114-
The output shows that the PowerShell drives on the computer included a drive mapped to the C:\Program Files directory.
121+
The output shows that the PowerShell drives on the computer included a drive mapped to the
122+
`C:\Program Files` directory.
115123

116124
### Example 7: Combine an indefinite number of paths
117125

@@ -138,6 +146,8 @@ parameter is still mandatory and must be specified as well.
138146
This parameter is specified with the `ValueFromRemainingArguments` property which enables
139147
joining an indefinite number of paths.
140148

149+
This parameter was added in PowerShell 6.0.
150+
141151
```yaml
142152
Type: System.String[]
143153
Parameter Sets: (All)
@@ -152,9 +162,8 @@ Accept wildcard characters: False
152162
153163
### -ChildPath
154164
155-
Specifies the elements to append to the value of the `Path` parameter.
156-
Wildcards are permitted.
157-
The `ChildPath` parameter is required, although the parameter name ("ChildPath") is optional.
165+
Specifies the elements to append to the value of the `Path` parameter. Wildcards are permitted. The
166+
`ChildPath` parameter is required, although the parameter name ("ChildPath") is optional.
158167

159168
```yaml
160169
Type: System.String
@@ -228,7 +237,10 @@ Accept wildcard characters: False
228237

229238
### CommonParameters
230239

231-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
240+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
241+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
242+
-WarningAction, and -WarningVariable. For more information, see
243+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
232244

233245
## INPUTS
234246

@@ -244,18 +256,17 @@ This cmdlet returns a string that contains the resulting path.
244256

245257
## NOTES
246258

247-
The cmdlets that contain the Path noun (the Path cmdlets) manipulate path names and return the
248-
names in a concise format that all PowerShell providers can interpret. They are designed for
249-
use in programs and scripts where you want to display all or part of a path name in a
250-
particular format. Use them like you would use Dirname, Normpath, Realpath, Join, or other path
251-
manipulators.
259+
The cmdlets that contain the Path noun (the Path cmdlets) manipulate path names and return the names
260+
in a concise format that all PowerShell providers can interpret. They are designed for use in
261+
programs and scripts where you want to display all or part of a path name in a particular format.
262+
Use them like you would use `Dirname`, `Normpath`, `Realpath`, `Join`, or other path manipulators.
252263

253264
You can use the path cmdlets with several providers, including the `FileSystem`, `Registry`, and
254265
`Certificate` providers.
255266

256-
This cmdlet is designed to work with the data exposed by any provider.
257-
To list the providers available in your session, type `Get-PSProvider`.
258-
For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
267+
This cmdlet is designed to work with the data exposed by any provider. To list the providers
268+
available in your session, type `Get-PSProvider`. For more information, see
269+
[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
259270

260271
## RELATED LINKS
261272

@@ -272,4 +283,3 @@ For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/a
272283
[Get-ChildItem](Get-ChildItem.md)
273284

274285
[Get-PSDrive](Get-PSDrive.md)
275-

0 commit comments

Comments
 (0)