Skip to content

Function "Get-FolderSizeInfo" can throw exception  #129

@Erikov-K

Description

@Erikov-K

Hello!

Firstly, Thank you for great function which calculate folder size using .NET.
It's work more than two times quickly on folders with millions of files.

I open issue, because function "Get-FolderSizeInfo" can throw exception at line 46 in code
if ($data.count -gt 1) {, when $data does not contains property "count".
This occurred in condition when folder is empty.
Exception: The property 'count' cannot be found on this object. Verify that the property exists.

I think, you can add this code before line 46 to solve issue
if (($data.psobject.members.name) -contains "count") {

Have a good day! :-)

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions