Get the absolute path of a relative path with Resolve-Path
Expand ~, .., and wildcards into full provider paths — and get back a relative path with -Relative.
01Command
$ Resolve-Path '..\logs\*.log'02What it does
Resolve-Path resolves the current location, so '..\logs' becomes e.g. 'C:\Work\logs' regardless of how the script was invoked. Each matching item is returned as a PathInfo object whose .Path property is the plain string. The often-missed -Relative flag prints matches relative to the current directory, and -LiteralPath handles paths containing [brackets] that would otherwise be treated as wildcards.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Resolve-Path | Microsoft LearnEvidence: Microsoft documents that Resolve-Path interprets wildcards and relative paths and returns the fully qualified provider path for each match.
- Resolve-Path - PowerShellEvidence: SS64 shows Resolve-Path resolving relative paths, ~, and wildcards to absolute paths, and -Relative for the reverse operation.
Last verified: 2026-09-17 · Category: Files & Folders
06Related solutions
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.
Search inside text files and logs with regex, returning file, line number and match.