PowerShell Logo Small

Join-Path



This is the built-in help made by Microsoft for the command 'Join-Path', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Combines a path and a child path into a single path. The provider supplies the path delimiters.

SYNTAX


Join-Path [-Path] <string[]> [-ChildPath] <string> [-Credential <PSCredential>] [-Resolve] [-UseTransaction] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Join-Path cmdlet combines a path and child-path into a single path. The provider supplies the path delimiters.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=113347
about_Providers
Test-Path
Split-Path
Resolve-Path
Convert-Path

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>join-path -path c:\win* -childpath System*



Description
-----------
This command uses Join-Path to combine the "c:\Win*" path with the "System*" child path. The Windows PowerShell file system provider, FileSystem
joins the path and adds the "\" delimiter.








-------------------------- EXAMPLE 2 --------------------------

C:\PS>join-path c:\win* System* -resolve



Description
-----------
This command displays the files and folders that are referenced by joining the "c:\Win*" path and the "System*" child path. It displays the same
files and folders as Get-ChildItem, but it displays the fully qualified path to each item. In this command, the Path and ChildPath optional param
eter names are omitted.








-------------------------- EXAMPLE 3 --------------------------

C:\PS>PS HKLM:\> join-path System *ControlSet* -resolve



Description
-----------
This command displays the registry keys in the HKLM\System registry subkey that include "ControlSet". This example shows how to use Join-Path wit
h the Windows PowerShell registry provider.








-------------------------- EXAMPLE 4 --------------------------

C:\PS>join-path -path C:, D:, E:, F: -childpath New



Description
-----------
This command uses Join-Path to combine multiple path roots with a child path.








-------------------------- EXAMPLE 5 --------------------------

C:\PS>get-psdrive -psprovider filesystem | foreach {$_.root} | join-path -childpath Subdir



Description
-----------
This command combines the roots of each Windows PowerShell file system drive in the console with the Subdir child path.

The command uses the Get-PSDrive cmdlet to get the Windows PowerShell drives supported by the FileSystem provider. The ForEach statement selects
only the Root property of the PSDriveInfo objects and combines it with the specified child path.

The output shows that the Windows PowerShell drives on the computer included a drive mapped to the C:\Program Files directory.