Join-Path - PowerShell command help and examples

Combines a path and a child path into a single path. The provider supplies the path delimiters. (Join-Path)


NAME
Join-Path
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>]
DESCRIPTION
The Join-Path cmdlet combines a path and child-path into a single path. The provider supplies the path delimiters.
PARAMETERS
-ChildPath <string> Specifies the elements to append to the value of Path. Wildcards are permitted. The ChildPath parameter is required, although the parameter name ("ChildPath") is optional. Required? true Position? 2 Default value Accept pipeline input? true (ByPropertyName) Accept wildcard characters? false -Credential <PSCredential> Specifies a user account that has permission to perform this action. The default is the current user. Type a user name, such as "User01" or "Domain01\User01". Or, enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. This parameter is not supported by any providers installed with Windows PowerShell. Required? false Position? named Default value Accept pipeline input? true (ByPropertyName) Accept wildcard characters? false -Path <string[]> Specifies the main path (or paths) to which the child-path is appended. Wildcards are permitted. The value of Path determines which provider joins the paths and adds the path delimiters. The Path parameter is required, although the parameter name ("Path") is optional. Required? true Position? 1 Default value Accept pipeline input? true (ByValue, ByPropertyName) Accept wildcard characters? false -Resolve [<SwitchParameter>] Displays the items that are referenced by the joined path. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false -UseTransaction [<SwitchParameter>] Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_Transactions. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false <CommonParameters> This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, type, "get-help about_commonparameters".
INPUTS
System.String You can pipe a string that contains a path to Join-Path.
OUTPUTS
System.String Join-Path returns a string that contains the resulting path.
NOTES
The cmdlets that contain the Path noun (the Path cmdlets) manipulate path names and return the names in a concise format that all Windows PowerShell providers can interpret. They are designed for use in programs and scripts where you want to display all or part of a path name in a particular format. Use them like you would use Dirname, Normpath, Realpath, Join, or other path manipulators. You can use the path cmdlets with several providers, including the FileSystem, Registry, and Certificate providers. The Join-Path cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type "Get-PSProvider". For more information, see about_Providers.

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 parameter 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 with 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. RELATED LINKS Online version: http://go.microsoft.com/fwlink/?LinkID=113347 about_Providers Test-Path Split-Path Resolve-Path Convert-Path C:\Windows>powershell get-help Convert-Path -full

Microsoft Windows [Version 10.0.19045.3693]
Copyright (c) 2023 Microsoft Corporation.

ColorConsole [Version 3.7.1000] PowerShell 2.0-Export

Windows 11, 10, 8.1, 8, 7 / Server 2022, 2019, 2016











Windows-10


... Windows 10 FAQ
... Windows 10 How To


Windows 10 How To


... Windows 11 How To
... Windows 10 FAQ



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

HTTP: ... PS_Windows/en/Join-Path.htm
0.092
17370
Kann ich unter Windows 11 auch Festplatten partitionieren/formatieren?
Can I create an Internet shortcut in the Windows 11 start menu?
How do I uninstall and install Cortana on Windows 11?
Die Farbe der Desktop Haft Notiz auf dem Desktop gefällt mir nicht!
Automatically log on Windows 11 / Autologin?
Can I save the desktop icon layout in the company excluding Admin rights?
Hilfe, die Grafikkarte hat 1 GB Grafikspeicher und hat mir bei Win-7 noch 2 weitere GB vom Arbeitsspeicher geklaut?
What are the individual test values or measurements for hard drives?
Kann man das Aero in Windows 7 zu 100 ausschalten, nicht nur deaktivieren?
Wie kann ich Auto-Play bei DVD, CD, USB deaktivieren in Windows-7?



(0)