22external help file : Microsoft.PowerShell.Commands.Management.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Management
5- ms.date : 06/09/2017
5+ ms.date : 02/26/2024
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.management/join-path?view=powershell-7.2&WT.mc_id=ps-gethelp
77schema : 2.0.0
88title : Join-Path
@@ -39,6 +39,7 @@ path\childpath
3939This command uses ` Join-Path ` to combine a path with a childpath.
4040
4141Since 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"
5051path\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
5860Join-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
7376HKLM:\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
106111D:\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.
138146This parameter is specified with the ` ValueFromRemainingArguments ` property which enables
139147joining an indefinite number of paths.
140148
149+ This parameter was added in PowerShell 6.0.
150+
141151``` yaml
142152Type : System.String[]
143153Parameter 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
160169Type: 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
253264You 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