22external help file : Microsoft.PowerShell.Commands.Management.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Management
5- ms.date : 02/26/2024
5+ ms.date : 03/25/2025
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.management/join-path?view=powershell-7.4&WT.mc_id=ps-gethelp
77schema : 2.0.0
88title : 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
3939This 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
5151path\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
6363This command displays the files and folders that are referenced by joining the ` C:\Win\* ` path and
6464the ` 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
7979This 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
8383provider path ` HKLM:\ `
8484
8585### Example 5: Combine multiple path roots with a child path
@@ -98,21 +98,23 @@ F:\New
9898This 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
110112C:\Subdir
111113D:\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
117119The command uses the ` Get-PSDrive ` cmdlet to get the PowerShell drives supported by the FileSystem
118120provider. 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
131133a\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
149149This 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
169168Type: 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
188187Type: 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
208204Type: System.String[]
@@ -220,8 +216,8 @@ Accept wildcard characters: True
220216
221217Indicates 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
227223Type: 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
264260You can use the path cmdlets with several providers, including the `FileSystem`, `Registry`, and
265261` Certificate` providers.
0 commit comments