Why does Get-PSDrive return the DisplayRoot Property in the Root Property column?

If I use:

Get-PSDrive K

I get some properties returned, amongst others the Root property, which looks like this:

PS C:\WINDOWS\system32> get-psdrive K
Name Used (GB) Free (GB) Provider Root
---- --------- --------- -------- ----
K FileSystem \\server\share

but if I select Root, I get this returned:

PS C:\WINDOWS\system32> get-psdrive K | select Root
Root
----
K:\

DisplayRoot returns the root as seen in my first command:

PS C:\WINDOWS\system32> get-psdrive K | select DisplayRoot
DisplayRoot
-----------
\\server\share

Format-List also returns them like my two commands above

PS C:\WINDOWS\system32> get-psdrive K | fl *
Used : 0
Free :
CurrentLocation :
Name : K
Provider : Microsoft.PowerShell.Core\FileSystem
Root : K:\
Description :
MaximumSize :
Credential : System.Management.Automation.PSCredential
DisplayRoot : \\server\share

I can just use DisplayRoot to get the UNC-Share, but why does Get-PSDrive on it's own return the DisplayRoot Property in the Root column? Is this by design?

I'm on:

PS C:\WINDOWS\system32> $PSVersionTable.PSVersion.ToString()
5.1.14393.2189
2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like