PSFolderSize
PSFolderSize copied to clipboard
Error when `Get-FolderSize` is executed in `/` on linux and Mac
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
Oh, I like this issue and fix. I think this would be great for simplifying how to search folder sizes in Linux. though there are a thousand tools for it, they are not as universal in many cases.
Taking a look at this next! Thanks for the information.