Skip to content

get-psdrive shows System.Span<UInt16>[0] on UNC drives #20895

@Jens-G

Description

@Jens-G

Prerequisites

Steps to reproduce

When running s a simple get-psdrive the list of drives should appear with the mount points listed under root. It works for old Powershell, but not for 7.4.0: Where onece was an UNC name is now simply System.Span<UInt16>[0] instead of a path.

Expected behavior

PS C:\> get-psdrive

Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
----           ---------     --------- --------      ----                                               ---------------
Alias                                  Alias
AllUsers            0,00         48,21 FileSystem    C:\ProgramData
C                 416,51         48,21 FileSystem    C:\                                                       Users\jg
Cert                                   Certificate   \
D                 272,66        658,72 FileSystem    D:\
Env                                    Environment
Function                               Function
HKCR                                   Registry      HKEY_CLASSES_ROOT
HKCU                                   Registry      HKEY_CURRENT_USER
HKLM                                   Registry      HKEY_LOCAL_MACHINE
Home                0,00         48,21 FileSystem    C:\Users\jg
J                 332,39         68,48 FileSystem    \\server\share\Bu...
K                8283,18         98,69 FileSystem    \\server\share\sa...
L                2048,11        633,01 FileSystem    \\server\share\pr...
M                2048,11        633,01 FileSystem    \\server\share\da...
N                8283,18         98,69 FileSystem    \\server\share\br...
O                8283,18         98,69 FileSystem    \\server\share\ar...
P                                      FileSystem    \\server\share\Ma...
Q                2048,11        633,01 FileSystem    \\server\share\Pr...
S                  75,66         27,34 FileSystem    \\server\share\se...
Scripts             0,00         48,21 FileSystem    C:\Users\jg\Do...
TaskBar             0,00         48,21 FileSystem    C:\Users\jg\AppData\Roaming\Micr...
U                8283,18         98,69 FileSystem    \\server\share\_s...
Variable                               Variable
WSMan                                  WSMan
X                2048,11        633,01 FileSystem    \\server\share\wo...
Z                8283,18         98,69 FileSystem    \\server\share\is...


PS C:\> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  3758


PS C:\>

Actual behavior

PS C:\> get-psdrive

Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
----           ---------     --------- --------      ----                                               ---------------
Alias                                  Alias
AllUsers          416,71         48,00 FileSystem    C:\ProgramData
C                 416,71         48,00 FileSystem    C:\                                               Users\jg\Desktop
Cert                                   Certificate   \
D                 272,66        658,72 FileSystem    D:\
Env                                    Environment
Function                               Function
HKCR                                   Registry      HKEY_CLASSES_ROOT
HKCU                                   Registry      HKEY_CURRENT_USER
HKLM                                   Registry      HKEY_LOCAL_MACHINE
Home              416,71         48,00 FileSystem    C:\Users\jg
J                 332,39         68,48 FileSystem    System.Span<UInt16>[0]
K                8283,18         98,69 FileSystem    System.Span<UInt16>[0]
L                2048,11        633,01 FileSystem    System.Span<UInt16>[0]
M                2048,11        633,01 FileSystem    System.Span<UInt16>[0]
N                8283,18         98,69 FileSystem    System.Span<UInt16>[0]
O                8283,18         98,69 FileSystem    System.Span<UInt16>[0]
P                                      FileSystem    System.Span<UInt16>[0]
Q                2048,11        633,01 FileSystem    System.Span<UInt16>[0]
S                  75,66         27,34 FileSystem    System.Span<UInt16>[0]
Scripts           416,71         48,00 FileSystem    C:\Users\jg\Documents\_Drive_D\Dev…
TaskBar           416,71         48,00 FileSystem    C:\Users\jg\AppData\Roaming\Micros…
Temp              416,71         48,00 FileSystem    C:\Users\jg\AppData\Local\Temp\
U                8283,18         98,69 FileSystem    System.Span<UInt16>[0]
Variable                               Variable
WSMan                                  WSMan
X                2048,11        633,01 FileSystem    System.Span<UInt16>[0]
Z                8283,18         98,69 FileSystem    System.Span<UInt16>[0]

PS C:\>

Error details

PS C:\> get-error
PS C:\>

Environment data

PS C:\> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      4      0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions