PSFolderSize icon indicating copy to clipboard operation
PSFolderSize copied to clipboard

OmitFolders requires full path(s)

Open sdsalyer opened this issue 4 years ago • 1 comments
trafficstars

Hi there,

Just wanted to point out the -OmitFolders parameter doesn't appear to work with relative paths, ie. if you CD into a location, and execute Get-FolderSize, the function assumes the current directory, but supplying a list of paths relative to the current directory to this parameter doesn't appear to work.

image

Not sure if you'd consider this a bug or a feature request? :) It might work to just add a call to Resolve-Path when doing your checks on the Omit list.

Hope this helps. Thanks for sharing your code!

Edit: Confirm Resolve-Path works from the input side at least, e.g. Get-FolderSize -OmitFolders (Resolve-Path .git) | Sort-Object SizeBytes -Descending. This, I think would also resolve wildcards, etc. so might be useful in other ways.

sdsalyer avatar Apr 05 '21 15:04 sdsalyer

I appreciate the feedback, and will work on making the usage more clear and add Resolve-Path.

Thanks!

gngrninja avatar Apr 09 '21 16:04 gngrninja