header image

Paths: IV

Posted by: | March 15, 2010 | No Comment |

The last of our path cmdlets is Convert-Path.  This converts a PowerShell path to a PowerShell provider path.

This sequence should explain how it works.

 

PS> cd HKLM:
PS> cd software
PS> cd microsoft
PS> Get-Location

Path
—-
HKLM:\software\microsoft

PS> Convert-Path -Path (Get-Location)
HKEY_LOCAL_MACHINE\software\microsoft

 

change drive to the HKLM: registry drive

navigate into the software\microsoft key

Get-Location returns the provider path i.e. file system style

Convert-path returns the path in the registry.

Technorati Tags: ,,
under: PowerShellV2