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

Doesn't work #4

Open
CollinChaffin opened this issue Jan 17, 2022 · 3 comments
Open

Doesn't work #4

CollinChaffin opened this issue Jan 17, 2022 · 3 comments

Comments

@CollinChaffin
Copy link

Not sure how you possibly tested this before publishing in the gallery...no matter what directory I give it after I hash my temp folder, it adds no new files doesn't honor recurse simply doesn't work. Would love this if it worked!

@Crypt32
Copy link
Collaborator

Crypt32 commented Jan 17, 2022

Can you be more specific about your issue?

@CollinChaffin
Copy link
Author

Here are my chronological runs should sum it up:

Run #1 broken right off the bat since this is the FIRST run, "12" seems to be some magic number here as the later runs show:

 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path C:\Temp -XML DB.XML
-----------------------------------
Total files processed      : 55
Total new added files      : 12
Total good files           : 0
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 43
-----------------------------------


Total   : 55
New     : 12
Ok      : 0
Bad     : 0
Missed  : 0
Locked  : 43
Unknown : 0
Deleted : 0

Run #2 fails because apparently unless you suddenly add the "include" switch, it sees no files in a root folder (THERE ARE 74 FILES IN MY D: ROOT):

 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path D:\ -XML DB.XML
-----------------------------------
Total files processed      : 0
Total good files           : 0
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 0
-----------------------------------


Total   : 0
New     : 0
Ok      : 0
Bad     : 0
Missed  : 0
Locked  : 0
Unknown : 0
Deleted : 0

Run #3, now only after adding include does it see the files as "processed"? No, they never were so it should have added far more than the 12 existing but shows how broken the logic is (THERE ARE 74 FILES IN MY D: ROOT):

 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path D:\ -Include *.* -XML DB.XML
-----------------------------------
Total files processed      : 12
Total good files           : 12
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 0
-----------------------------------


Total   : 12
New     : 0
Ok      : 12
Bad     : 0
Missed  : 0
Locked  : 0
Unknown : 0
Deleted : 0

Run #4, let's give it a huge folder structure to scan:

 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path 'D:\Data\My Documents\' -Recurse -XML DB.XML
-----------------------------------
Total files processed      : 12
Total good files           : 12
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 0
-----------------------------------


Total   : 12
New     : 0
Ok      : 12
Bad     : 0
Missed  : 0
Locked  : 0
Unknown : 0
Deleted : 0

As you can see...very broken.

@CollinChaffin
Copy link
Author

Code comment: "# if XML file exist, process and check all records. XML file will not be modified."

Reading the subsequent code, your logic is totally broken. Once it sees a XML file exists, it will never add new entries. In addition, checking for the path ending in a slash breaks the ability to start at a root drive folder. Also, the logic on checking for a wildcard for "include" is broken. Once it reads the existing XML, it then erroneously dumps that same XML into whatever path you scan. I scanned 4 paths, each now has a duplicate copy of the first XML (the one run that added anything).

I don't see how there is any way this could have been tested before publishing it.

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

2 participants