DirectoryInfo object Length property is 1 - by Bill_Stewart

Status : 


Sign in
to vote
ID 836319 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 3/18/2014 1:05:47 PM
Access Restriction Public


In PowerShell 2.0, DirectoryInfo objects don't have a Length property (as expected):

PS C:\> (get-item MyDir).Length
PS C:\>

In PowerShell 3.0, DirectoryInfo objects have a Length property (Int32) of 1:

PS C:\> (get-item MyDir).Length
PS C:\>

This seems peculiar. I don't know whether this problem occurs in PowerShell 4.0 or not.
Sign in to post a comment.
Posted by Bill_Stewart on 3/18/2014 at 2:46 PM
This is a duplicate of

Agree with 793560 that a different property name should have been chosen.