Skip to content

Error when Get-FolderSize is executed in / on linux and Mac #29

@aristosvo

Description

@aristosvo

On linux and Mac I've an error showing up when the command is triggered in /.

Setup:

PS /> Get-Host | Select-Object Version

Version
-------
7.1.4
PS /> (Get-Location)

Path
----
/

Command and Error:

PS /> (Get-FolderSize -FolderName 'etc') 
Split-Path: /root/.local/share/powershell/Modules/PSFolderSize/1.7.1/Functions/Private/Get-FolderList.ps1:72
Line |
  72 |          $splitPath = Split-Path -Path $BasePath
     |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot process argument because the value of argument "path"
     | is not valid. Change the value of the "path" argument and run
     | the operation again.

Workaround:

PS /> (Get-FolderSize -FolderName 'etc' -Path '.')

FolderName                     SizeMB       SizeGB       FullPath
----------                     ------       ------       --------
etc                            3.37         0            /etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions