Skip to content

OmitFolders requires full path(s) #25

@sdsalyer

Description

@sdsalyer

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.

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