NAME
Resolve-Path
SYNOPSIS
Resolves the wildcard characters in a path, and displays the path contents.SYNTAX
Resolve-Path [-Credential
[] -LiteralPath [-Relative] [-UseTransaction] ] Resolve-Path [-Path]
[-Credential ] [-Relative] [-UseTransaction] [ ] DESCRIPTION
The Resolve-Path cmdlet interprets the wildcard characters in a path and displays the items and containers at the
location specified by the path, such as the files and folders or registry keys and subkeys.PARAMETERS
-Credential
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 bythe Get-Credential cmdlet. If you type a user name, this cmdlet prompts you for a password.
This parameter is not supported by any providers installed with Windows PowerShell. Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-LiteralPath
Specifies the path to be resolved. The value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcard characters. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. Required? true Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Path
Specifies the Windows PowerShell path to resolve. This parameter is required. You can also pipe a path stringto Resolve-Path .
Required? true Position? 0 Default value NoneAccept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false-Relative [
Indicates that this cmdlet returns a relative path. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] -UseTransaction [
Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). INPUTS
System.String You can pipe a string that contains a path to this cmdlet.OUTPUTS
System.Management.Automation.PathInfo, System.String This cmdlet returns a string that contains the resolved path, if you specify the Relative parameter. Otherwise, it returns a PathInfo object.NOTES
The cmdlets that contain the Path noun (the Path cmdlets) work with 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 as you would useDirname , Normpath , Realpath , Join *, or other path manipulators. You can use the Path * cmdlets with
several providers. These include the FileSystem, Registry, and Certificate providers. Resolve-Path * 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.
Example 1: Resolve the current path
PS C:\>Resolve-Path ~
Path----
C:\Users\User01 This command resolves the path represented by the tilde character (~), which represents the home path of a file system drive, such as C:.Example 2: Resolve the path of the Windows folder
PS C:\>Resolve-Path -Path "windows"
Path----
C:\Windows When run from the root of the C: drive, this command returns the path of the Windows folder in the C: drive.Example 3: Get all paths in the Windows folder
PS C:\>"C:\windows\*" | Resolve-Path
This command returns all of the folders in the C:\Windows folder. The command uses a pipeline operator (|) to senda path string to Resolve-Path .
Example 4: Resolve a UNC path
PS C:\>Resolve-Path -Path "\\Server01\public"
This command resolves a Universal Naming Convention (UNC) path and returns the shares in the path.Example 5: Get relative paths
PS C:\>Resolve-Path -Path "c:\prog*" -Relative
..\Program Files ..\Program Files (x86) ..\programs.txt This command returns relative paths for the directories at the root of the C: drive.Example 6: Resolve a path that contains brackets
PS C:\>Resolve-Path -LiteralPath 'test[xml]'
This command resolves the path of the Test[xml] subfolder of the current folder. It uses the LiteralPath parameter to indicate that the brackets are not regular expression characters.RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=821624Convert-Path
Join-Path
Split-Path
Test-Path