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

Folder Name ending with . would be created successfully without . at the end while reporting success without catching exception - leading to following reference to that folder failed #168

Closed
amdishigh opened this issue Dec 24, 2020 · 1 comment · Fixed by #170
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@amdishigh
Copy link

amdishigh commented Dec 24, 2020

Expected Behavior

When movetofolder is enabled, and one of folder name to be created is with "." at end, the folder should be created without "." at end intendenly

Current Behavior

The folder would be created without "." at end un-inendenly, i.e. OS create it without "." for us without error, thus script believe it's created successfully - while actually it's not. Thus, following code while creating files within that folder, that would be failed

Steps to Reproduce (for bugs)

Your Environment

  • Module version used: 2.2.2
  • Operating System and PowerShell version: Windows / PowerShell 7.1

##Solution
One quick workaround is to trim "." at the end before we create it, below is what I added to fix it - but sure if any other code need such fix or any better solution.

In Set-JVMovie.ps1, before if ($Force -or $PSCmdlet.ShouldProcess($Path)) {

Add: $folderPath = $folderPath.TrimEnd(".")

@amdishigh amdishigh changed the title Folder Name ending with . would be created successfully without . at the end while reporting catching exception - leading to following reference to that folder failed Folder Name ending with . would be created successfully without . at the end while reporting success without catching exception - leading to following reference to that folder failed Dec 24, 2020
@jvlflame jvlflame self-assigned this Dec 24, 2020
@jvlflame
Copy link
Collaborator

Good idea, I'll implement it in that way. I was thinking about it for a while the other day but wasn't sure how to go about it. #163

@jvlflame jvlflame added bug Something isn't working enhancement New feature or request labels Dec 24, 2020
@jvlflame jvlflame linked a pull request Dec 26, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants