Skip to content

Allow trailing back-slashes in paths and use proper join-path/io class to handle paths #2265

Merged
dpaulson45 merged 2 commits into
microsoft:mainfrom
michelderooij:main
Jan 14, 2025
Merged

Allow trailing back-slashes in paths and use proper join-path/io class to handle paths #2265
dpaulson45 merged 2 commits into
microsoft:mainfrom
michelderooij:main

Conversation

@michelderooij
Copy link
Copy Markdown
Contributor

Issue:
For $XMLDirectoryPath, you check if the path does not end in a back-slash. For $OutputFilePath, you do the same as well as test the path. The description mentions the trailing "requirement" of one, but not the other - inconsistent. Test-Path for both suffices.

Reason:
Accepting trailing slashes is convenient, as tab-completion adds trailing back-slash automatically. Also removes inconsistency.

Fix:
Use Test-Path for both in parameter validation. Used Join-Path etc to properly construct paths, and [System.IO.Path]::changeExtension instead of string operations.

Validation:
Tested against local and remote servers, using local and UNC paths

…lash. For $OutputFilePath, you do the same as well as test the path. The description mentions the trailing "requirement" of one, but not the other - inconsistent. Test-Path for both suffices; accepting trailing slashes is convenient, as tab-completion adds trailing back-slash automatically. Used Join-Path etc to properly construct paths, and [System.IO.Path]::changeExtension instead of string operations.
@michelderooij michelderooij requested a review from a team as a code owner January 11, 2025 22:10
@bill-long
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@bill-long
Copy link
Copy Markdown
Member

Thank you for the PR. Please make CodeFormatter happy:

image

Looks good to me otherwise. You can run CodeFormatter locally prior to submission as noted in CONTRIBUTING.md.

@dpaulson45
Copy link
Copy Markdown
Member

@michelderooij please address the code formatting rule as soon as you can.

@dpaulson45
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dpaulson45 dpaulson45 merged commit 433ea1e into microsoft:main Jan 14, 2025
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

Successfully merging this pull request may close these issues.

3 participants