Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testsubfolders #85

Open
obhayes opened this issue Jan 30, 2023 · 0 comments
Open

Testsubfolders #85

obhayes opened this issue Jan 30, 2023 · 0 comments

Comments

@obhayes
Copy link

obhayes commented Jan 30, 2023

Hi,
Many thanks for the script, i was evaluating / testing it out and it would seem when I took the approach of supplying an input file and including the parameter TestSubfolders e..g

Get-FolderAge -inputfile "C:\Temp\FolderList.txt" -outputfile "C:\temp\FolderOutput.csv" -TestSubFolders

it only evaluates that folder and the child folder one level deep not all child folders, i.e it missed folders.

I think you need to add the -recurse on this line and that will fix it
$FolderList = @(Get-ChildItem $FolderEntry -recurse -Directory -ea SilentlyContinue | Select -Expand FullName)

i am not a powershell expert but the above seemed to fix it.

Technically you could generate the input file with all the subfolder names, so possibly this is not even bug. I just assumed adding in some top level folders into the input file would also do the sub folders/ children. I like the approach of using an input file so i can batch the process by doing x folders at a time. Possibly an update to the explanation of testsubfolders is needed to explain what it does / does not do.

Appreciate this was last looked at 4 years ago, but if someone else happens to read this it maybe of use, rather than folders get missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant