Skip to content

Commit 11eabae

Browse files
authored
Merge pull request #11952 from MicrosoftDocs/main
3/25/2025 PM Publish
2 parents 341c187 + d48addb commit 11eabae

File tree

10 files changed

+199
-164
lines changed

10 files changed

+199
-164
lines changed

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

Lines changed: 29 additions & 30 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: 02/26/2024
5+
ms.date: 03/25/2025
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
@@ -15,8 +15,8 @@ Combines a path and a child path into a single path.
1515
## SYNTAX
1616

1717
```
18-
Join-Path [-Path] <String[]> [-ChildPath] <String> [-Resolve] [-Credential <PSCredential>] [-UseTransaction]
19-
[<CommonParameters>]
18+
Join-Path [-Path] <String[]> [-ChildPath] <String> [-Resolve] [-Credential <PSCredential>]
19+
[-UseTransaction] [<CommonParameters>]
2020
```
2121

2222
## DESCRIPTION
@@ -29,7 +29,7 @@ The provider supplies the path delimiters.
2929
### Example 1: Combine a path with a child path
3030

3131
```powershell
32-
PS C:\> Join-Path -Path "path" -ChildPath "childpath"
32+
Join-Path -Path "path" -ChildPath "childpath"
3333
```
3434

3535
```output
@@ -38,21 +38,21 @@ 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
42-
the paths.
41+
Since the command is executed from the **FileSystem** provider, it provides the `\` delimiter to
42+
join the paths.
4343

4444
### Example 2: Combine paths that already contain directory separators
4545

4646
```powershell
47-
PS C:\> Join-Path -Path "path\" -ChildPath "\childpath"
47+
Join-Path -Path "path\" -ChildPath "\childpath"
4848
```
4949

5050
```output
5151
path\childpath
5252
```
5353

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

5757
### Example 3: Display files and folders by joining a path with a child path
5858

@@ -62,8 +62,8 @@ Join-Path "C:\win*" "System*" -Resolve
6262

6363
This command displays the files and folders that are referenced by joining the `C:\Win\*` path and
6464
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.
65+
displays the fully qualified path to each item. In this command, the **Path** and **ChildPath**
66+
optional parameter names are omitted.
6767

6868
### Example 4: Use Join-Path with the PowerShell Registry provider
6969

@@ -79,7 +79,7 @@ HKLM:\System\CurrentControlSet
7979
This command displays the registry keys in the `HKLM\System` registry subkey that include
8080
`ControlSet`.
8181

82-
The `Resolve` parameter, attempts to resolve the joined path, including wildcards from the current
82+
The **Resolve** parameter, attempts to resolve the joined path, including wildcards from the current
8383
provider path `HKLM:\`
8484

8585
### Example 5: Combine multiple path roots with a child path
@@ -98,21 +98,23 @@ F:\New
9898
This command uses `Join-Path` to combine multiple path roots with a child path.
9999

100100
> [!NOTE]
101-
> The Drives specified by `Path` must exist or the join of that entry will fail.
101+
> The Drives specified by **Path** must exist or the join of that entry will fail.
102102
103103
### Example 6: Combine the roots of a file system drive with a child path
104104

105105
```powershell
106-
Get-PSDrive -PSProvider FileSystem | ForEach-Object {$_.Root} | Join-Path -ChildPath "Subdir"
106+
Get-PSDrive -PSProvider FileSystem |
107+
ForEach-Object {$_.Root} |
108+
Join-Path -ChildPath "Subdir"
107109
```
108110

109111
```output
110112
C:\Subdir
111113
D:\Subdir
112114
```
113115

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

117119
The command uses the `Get-PSDrive` cmdlet to get the PowerShell drives supported by the FileSystem
118120
provider. The `ForEach-Object` statement selects only the **Root** property of the **PSDriveInfo**
@@ -143,9 +145,9 @@ Accept wildcard characters: True
143145
### -Credential
144146
145147
> [!NOTE]
146-
> This parameter is not supported by any providers installed with PowerShell.
147-
> To impersonate another user, or elevate your credentials when running this cmdlet,
148-
> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md).
148+
> This parameter isn't supported by any providers installed with PowerShell. To impersonate another
149+
> user, or elevate your credentials when running this cmdlet, use
150+
> [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md).
149151
150152
```yaml
151153
Type: System.Management.Automation.PSCredential
@@ -161,11 +163,8 @@ Accept wildcard characters: False
161163
162164
### -Path
163165
164-
Specifies the main path (or paths) to which the child-path is appended.
165-
Wildcards are permitted.
166-
167-
The value of `Path` determines which provider joins the paths and adds the path delimiters.
168-
The `Path` parameter is required, although the parameter name ("Path") is optional.
166+
Specifies the main path (or paths) to which the child-path is appended. The value of **Path**
167+
determines which provider joins the paths and adds the path delimiters. Wildcards are permitted.
169168
170169
```yaml
171170
Type: System.String[]
@@ -183,8 +182,8 @@ Accept wildcard characters: True
183182
184183
Indicates that this cmdlet should attempt to resolve the joined path from the current provider.
185184
186-
- If wildcards are used, the cmdlet returns all paths that match the joined path.
187-
- If **no** wildcards are used, the cmdlet will error if the path does not exist.
185+
- If you use wildcards, the cmdlet returns all paths that match the joined path.
186+
- If you don't use wildcards, the cmdlet returns an error if the path doesn't exist.
188187
189188
```yaml
190189
Type: System.Management.Automation.SwitchParameter
@@ -237,10 +236,10 @@ This cmdlet returns a string that contains the resulting path.
237236
238237
## NOTES
239238
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.
239+
The cmdlets that contain the Path noun manipulate path names and return the names in a concise
240+
format that all PowerShell providers can interpret. They're designed to be used where you want to
241+
display all or part of a path in a particular format. Use them like you would use `Dirname`,
242+
`Normpath`, `Realpath`, `Join`, or other path manipulators.
244243

245244
You can use the path cmdlets with several providers, including the `FileSystem`, `Registry`, and
246245
`Certificate` providers.

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

Lines changed: 34 additions & 38 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: 02/26/2024
5+
ms.date: 03/25/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/join-path?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Join-Path
@@ -29,7 +29,7 @@ The provider supplies the path delimiters.
2929
### Example 1: Combine a path with a child path
3030

3131
```powershell
32-
PS C:\> Join-Path -Path "path" -ChildPath "childpath"
32+
Join-Path -Path "path" -ChildPath "childpath"
3333
```
3434

3535
```output
@@ -38,21 +38,21 @@ 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
42-
the paths.
41+
Since the command is executed from the **FileSystem** provider, it provides the `\` delimiter to
42+
join the paths.
4343

4444
### Example 2: Combine paths that already contain directory separators
4545

4646
```powershell
47-
PS C:\> Join-Path -Path "path\" -ChildPath "\childpath"
47+
Join-Path -Path "path\" -ChildPath "\childpath"
4848
```
4949

5050
```output
5151
path\childpath
5252
```
5353

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

5757
### Example 3: Display files and folders by joining a path with a child path
5858

@@ -62,8 +62,8 @@ Join-Path "C:\win*" "System*" -Resolve
6262

6363
This command displays the files and folders that are referenced by joining the `C:\Win\*` path and
6464
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.
65+
displays the fully qualified path to each item. In this command, the **Path** and **ChildPath**
66+
optional parameter names are omitted.
6767

6868
### Example 4: Use Join-Path with the PowerShell Registry provider
6969

@@ -79,7 +79,7 @@ HKLM:\System\CurrentControlSet
7979
This command displays the registry keys in the `HKLM\System` registry subkey that include
8080
`ControlSet`.
8181

82-
The `Resolve` parameter, attempts to resolve the joined path, including wildcards from the current
82+
The **Resolve** parameter, attempts to resolve the joined path, including wildcards from the current
8383
provider path `HKLM:\`
8484

8585
### Example 5: Combine multiple path roots with a child path
@@ -98,21 +98,23 @@ F:\New
9898
This command uses `Join-Path` to combine multiple path roots with a child path.
9999

100100
> [!NOTE]
101-
> The Drives specified by `Path` must exist or the join of that entry will fail.
101+
> The Drives specified by **Path** must exist or the join of that entry will fail.
102102
103103
### Example 6: Combine the roots of a file system drive with a child path
104104

105105
```powershell
106-
Get-PSDrive -PSProvider FileSystem | ForEach-Object {$_.Root} | Join-Path -ChildPath "Subdir"
106+
Get-PSDrive -PSProvider FileSystem |
107+
ForEach-Object {$_.Root} |
108+
Join-Path -ChildPath "Subdir"
107109
```
108110

109111
```output
110112
C:\Subdir
111113
D:\Subdir
112114
```
113115

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

117119
The command uses the `Get-PSDrive` cmdlet to get the PowerShell drives supported by the FileSystem
118120
provider. The `ForEach-Object` statement selects only the **Root** property of the **PSDriveInfo**
@@ -131,20 +133,18 @@ Join-Path a b c d e f g
131133
a\b\c\d\e\f\g
132134
```
133135

134-
The `AdditionalChildPath` parameter allows the joining of an unlimited number of paths.
136+
The **AdditionalChildPath** parameter allows the joining of an unlimited number of paths.
135137

136-
In this example, no parameter names are used, thus "a" binds to `Path`, "b" to `ChildPath` and
137-
"c-g" to `AdditionalChildPath`
138+
In this example, no parameter names are used, thus "a" binds to **Path**, "b" to **ChildPath** and
139+
"c-g" to **AdditionalChildPath**.
138140

139141
## PARAMETERS
140142

141143
### -AdditionalChildPath
142144

143-
Specifies additional elements to append to the value of the *Path* parameter. The `ChildPath`
144-
parameter is still mandatory and must be specified as well.
145-
146-
This parameter is specified with the `ValueFromRemainingArguments` property which enables
147-
joining an indefinite number of paths.
145+
Specifies additional elements to append to the value of the **Path** parameter. The **ChildPath**
146+
parameter is still mandatory and must be specified as well. This parameter is specified with the
147+
`ValueFromRemainingArguments` property, which enables joining an indefinite number of paths.
148148

149149
This parameter was added in PowerShell 6.0.
150150

@@ -162,8 +162,7 @@ Accept wildcard characters: False
162162
163163
### -ChildPath
164164
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.
165+
Specifies the elements to append to the value of the `Path` parameter. Wildcards are permitted.
167166

168167
```yaml
169168
Type: System.String
@@ -180,9 +179,9 @@ Accept wildcard characters: True
180179
### -Credential
181180

182181
> [!NOTE]
183-
> This parameter is not supported by any providers installed with PowerShell.
184-
> To impersonate another user, or elevate your credentials when running this cmdlet,
185-
> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md).
182+
> This parameter isn't supported by any providers installed with PowerShell. To impersonate another
183+
> user, or elevate your credentials when running this cmdlet, use
184+
> [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md).
186185

187186
```yaml
188187
Type: System.Management.Automation.PSCredential
@@ -198,11 +197,8 @@ Accept wildcard characters: False
198197

199198
### -Path
200199

201-
Specifies the main path (or paths) to which the child-path is appended.
202-
Wildcards are permitted.
203-
204-
The value of `Path` determines which provider joins the paths and adds the path delimiters.
205-
The `Path` parameter is required, although the parameter name ("Path") is optional.
200+
Specifies the main path (or paths) to which the child-path is appended. The value of **Path**
201+
determines which provider joins the paths and adds the path delimiters. Wildcards are permitted.
206202

207203
```yaml
208204
Type: System.String[]
@@ -220,8 +216,8 @@ Accept wildcard characters: True
220216

221217
Indicates that this cmdlet should attempt to resolve the joined path from the current provider.
222218

223-
- If wildcards are used, the cmdlet returns all paths that match the joined path.
224-
- If **no** wildcards are used, the cmdlet will error if the path does not exist.
219+
- If you use wildcards, the cmdlet returns all paths that match the joined path.
220+
- If you don't use wildcards, the cmdlet returns an error if the path doesn't exist.
225221

226222
```yaml
227223
Type: System.Management.Automation.SwitchParameter
@@ -256,10 +252,10 @@ This cmdlet returns a string that contains the resulting path.
256252

257253
## NOTES
258254

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.
255+
The cmdlets that contain the Path noun manipulate path names and return the names in a concise
256+
format that all PowerShell providers can interpret. They're designed to be used where you want to
257+
display all or part of a path in a particular format. Use them like you would use `Dirname`,
258+
`Normpath`, `Realpath`, `Join`, or other path manipulators.
263259

264260
You can use the path cmdlets with several providers, including the `FileSystem`, `Registry`, and
265261
`Certificate` providers.

0 commit comments

Comments
 (0)