PowerShell for Windows Admins

Oct 31 2019   2:22PM GMT

Resolve-Path

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Tags:
Powershell

Resolve-Path is a cmdlet I haven’t used much – if at all – so I thought I should have a look at it.

At an arbitrary point in the file system:

PS> Get-Location

Path
—-
C:\Scripts\Modules\Coordinates

.. Indicates the next level up

PS> Get-ChildItem -Path ..

Directory: C:\Scripts\Modules

etc

..\.. indicates two levels up

PS> Get-ChildItem -Path ..\..

Directory: C:\Scripts

etc

Resolve-Path will resolve any use of wildcards and other characters with meaning into the full path

PS> Resolve-Path -Path ..

Path
—-
C:\Scripts\Modules

PS> Resolve-Path -Path ..\..

Path
—-
C:\Scripts

Note that

PS> Resolve-Path -Path .

Path
—-
C:\Scripts\Modules\Coordinates

is effectively the same as Get-Location

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: