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

"Being the richest man in the cemetery doesn’t matter to me...
Going to bed at night saying we've done something wonderful... that's what matters to me" ~ Steve Jobs

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-2024 SS64.com
Some rights reserved