-
Notifications
You must be signed in to change notification settings - Fork 8
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
-Mirror parameter doesn't work properly #7
Comments
Sorry for taking so long to come back to you on this. I've not been able to reproduce the issue you describe on either MacOS or Windows. Can you let me know what version of the module you were using? ( |
Hi, I have been using your module and I am also experiencing this issue as well. The folder given to -Path needs to have subfolders within it that contain files. Below are some details about what I found looking into what was occurring.
This was causing all of the files copied over to "C:\That\Is\DestinationStuff" and then files to be deleted that were not in the root of the folder. This was due to the path coming back during the formation of $SourceFile as malformed:
Where $SourceFile was coming back as Which the code is then doing Test-Path for each of those, rightfully coming back as $False, and doing the Remove-Item operation on each $DestFile not within the root directory. Changing line 110 to no longer append the Folder separator fixes this behavior (not sure what the intent was of doing that Join-Path there with '/' ):
I thought I'd add my experience with this particular issue. Thank you for making this module! |
Hi! Awesome module, thank you! Buggy: Fixed: Is there is any way to contribute I could perform this fix on the master branch |
I, too, was in great need of a module like this and it works great for new or modified files. Thanks! edit: well, that was easier than I expected and now the script does the trick! |
Hey, this module is really awesome! However, the
-Mirror
parameter doesn't work correctly for me - it deletes all of the files I want to copy across for some reason. A way to reproduce it is:-Mirror
switch-Mirror
and the-WhatIf
switches - it will tell you that it's going to delete all the filesEDIT: After a bit more checking:
Not working:
Copy-FileHash -Path C:\somePath -Destination C:\someOtherPath
Working:
Copy-FileHash -Path C:\somePath\ -Destination C:\someOtherPath\
The text was updated successfully, but these errors were encountered: