Convert-Path

Convert a path from a Windows PowerShell path to a Windows PowerShell provider path.

Syntax
 Convert-Path [-path] string[] [-UseTransaction] [CommonParameters ]
 Convert-Path [-literalPath] string[] [-UseTransaction] [CommonParameters ]
key
 -Path path The path to be converted
 -literalPath string
 The path to be converted. The value of -LiteralPath is used exactly
 as typed. No characters are interpreted as wildcards.
 If the path includes escape characters, enclose them in single quotes. 
 -UseTransaction
 Include the command in the active transaction.

Standard Aliases for Convert-Path: cvpa

Examples

Expand the current working directory, which is represented by a dot:

PS C:\> Convert-Path .
C:\Demo\work

Expand the current users home directory and convert to upper case:

PS C:\> (Convert-Path ~).toUpper()
C:\USERS\ALICE

Convert a PowerShell provider path to a standard registry path:

PS C:\> Convert-Path HKLM:\software\microsoft
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT

"Don’t worry that you can’t seem to come up with sure billion dollar winners at first. Just do projects for yourself for fun. You’ll get better and better" ~ Steve Wozniak

Related PowerShell Cmdlets

join-path - Combine a path and child-path.
resolve-path - Resolves the wildcards in a path.
split-path - Return part of a path.
test-path - Return true if the path exists, otherwise return false.
get-help about_namespace.

(追記) (追記ここまで)
Copyright © 1999-2026 SS64.com
Some rights reserved

AltStyle によって変換されたページ (->オリジナル) /