Resolve-Path

 

SYNOPSIS

Resolves the wildcard characters in a path and displays the path contents.

 

SYNTAX

Resolve-Path [-path] <string[]> [-credential <PSCredential>] [<CommonParameters>]

 

Resolve-Path [-literalPath] <string[]> [-credential <PSCredential>] [<CommonParameters>]

 

DETAILED DESCRIPTION

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. The names appear just as they are represented in the drive, including capitalization..

 

PARAMETERS

 

-path <string[]>

Specifies the Windows PowerShell path to resolve.

 

Required?

true

Position?

1

Default value

 

Accept pipeline input?  

true (ByValue, ByPropertyName)

Accept wildcard characters? 

true

 

-credential <PSCredential>

Uses a credential to validate access to the resource. <Credential> represents a user-name, such as "User01" or "Domain01\User01", or a PSCredential object, such as the one retrieved by using the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. This parameter appears, but it is not supported in any Windows PowerShell core cmdlets or providers.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

true (ByPropertyName)

Accept wildcard characters? 

false

 

-literalPath <string[]>

Specifies the path to be resolved. The value of -LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. 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?

1

Default value

 

Accept pipeline input?  

true (ByPropertyName)

Accept wildcard characters? 

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".

 

INPUT TYPE

String

 

RETURN TYPE

String

 

NOTES

 

For more information, type "Get-Help Resolve-Path -detailed". For technical information, type "Get-Help Resolve-Path -full".

 

The path cmdlets (*-path) 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.

 

 When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

 

EXAMPLE 1

 

resolve-path ~ | format-list

 

The ~ character signifies the home path. This example will return the full home path.

 

Drive: C

Provider : System.Management.Automation.ProviderInfo

ProviderPath : C:\Documents and Settings\username

Path : C:\Documents and Settings\username

 

EXAMPLE 2

 

resolve-path windows\*| format-list

 

This example starts at the current location and returns the paths to all items in the Windows folder. In this case, there is only one.

 

Drive: C

Provider : System.Management.Automation.ProviderInfo

ProviderPath : C:\Documents and Settings\username\windows\system

Path : C:\Documents and Settings\username\windows\system

 

EXAMPLE 3

 

resolve-path "C:\windows\*"| format-list

 

This example goes to the C:\Windows folder and returns the pathnames of everything in there. Be aware that the use of quote marks surrounding the path because it is other than the current location.

 

Drive: C

Provider : System.Management.Automation.ProviderInfo

ProviderPath : C:\windows\addins

Path : C:\windows\addins

 

Drive: C

Provider : System.Management.Automation.ProviderInfo

ProviderPath : C:\windows\AppPatch

Path : C:\windows\AppPatch

 

Drive: C

Provider : System.Management.Automation.ProviderInfo

ProviderPath : C:\windows\assembly

Path : C:\windows\assembly

...

 

RELATED LINKS

Test-Path

Split-Path

Convert-Path

Join-Path

about_namespace