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

Script is ignoring files with square brackets? #3

Closed
LifeLifeLP opened this issue Mar 24, 2022 · 3 comments
Closed

Script is ignoring files with square brackets? #3

LifeLifeLP opened this issue Mar 24, 2022 · 3 comments

Comments

@LifeLifeLP
Copy link

LifeLifeLP commented Mar 24, 2022

Hey man, great script, its very helpful sorting files among large amounts.

Here 2 files that do not get moved, I have full perms on them so IDK why they are not moved, ignored.

Microsoft Windows 98 Second Edition (4.10.2222) [German] (ISO).7z
Microsoft Works 8.5 [Ger].iso

@giuscond
Copy link
Owner

I did some tests and it's a bug. I investigated and the problem is here if (Test-Path -Path $f -PathType Leaf )
I don't know why Test-Path don't recognize files with square brackets. I did tests with curly brackets and special characthers and all is ok. The problem show up only with square brackets. I'll investigate more and I'll try to make a fix,
Thanks for your feedback!

@laurinschubert
Copy link

laurinschubert commented Mar 27, 2022

Hi, in order to fix it, you should replace -Path with -LiteralPath and add quotation marks so square brackets are not interpreted as escape characters.

@giuscond
Copy link
Owner

I fix the bug and uploaded a new version 0.3.1 with -LiteralPath. Now it works with square brackets too.
Thanks for your help.

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

3 participants