Skip to content

Resolve-Path whilst in a PSDrive doesnt return the full (non-relative to PSDrive) path  #2403

@kilasuit

Description

@kilasuit

When in a script or interactive use and you have defined a PSDrive as a shortlink to another location on the same disk Resolve-Path returns the PSDrive relative file path whereas I think that it should be able to return the actual full file path instead similarly to how Get-Item returns the non-relative PSDrive path and shows this correctly under the PSPath & Fullname properties

Steps to reproduce

Create new PSDrive to C:\temp folder - New-PSDrive -Name CT -Root C:\temp -Provider FileSystem
Create file test.txt in C:\temp folder - New-Item C:\temp\test.txt
cd to the PSDrive -Set-location CT:\
Run Resolve-Path test.txt

Expected behavior

Resolve-Path returns the full path to the file so output should be C:\temp\test.txt

Actual behavior

Resolve-Path returns the PSDrive relative path so it returns CT:\test.txt

Environment data

Name                           Value                                                                                                                                                                      
----                           -----                                                                                                                                                                      
PSVersion                      5.1.14393.187                                                                                                                                                              
PSEdition                      Desktop                                                                                                                                                                    
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                    
BuildVersion                   10.0.14393.187                                                                                                                                                             
CLRVersion                     4.0.30319.42000                                                                                                                                                            
WSManStackVersion              3.0                                                                                                                                                                        
PSRemotingProtocolVersion      2.3                                                                                                                                                                        
SerializationVersion           1.1.0.1                                                                                                                                                                    

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-Won't FixThe issue won't be fixed, possibly due to compatibility reason.WG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions