PowerShell: Path Expansion (get fullpath)

By Xah Lee. Date: . Last updated: .

Some characters have special meaning in the value of Path parameter. Example:

Path will be “expanded”, to result in full path or multiple paths. This is called path expansion.

Path expansion happen after string expansion. [see PowerShell: String]

To see what a given path expand to, use Resolve-Path.

Resolve-Path
Resolves the wildcard characters in a path, show result.
Resolve-Path ~/

# Path
# ----
# C:\Users\xah
Resolve-Path "~/Documents/*"

# Path
# ----
# C:\Users\xah\Documents\PowerShell
# C:\Users\xah\Documents\Wolfram Desktop
# C:\Users\xah\Documents\wolframlang

Note: quoted path goes thru string expansion first, then go thru path expansion. To not go thru path expansion, use parameter LiteralPath.

PowerShell Path


PowerShell in Depth

Path

Pipe

Comment

Value Types

String

Variable

Boolean

Conditional

Data Structure

Loop and Iteration

Input/Output

Function

Profile and Script

Script Examples

Misc