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

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

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

michelderooij
Copy link
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
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bill-long
Copy link
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
Member

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

@dpaulson45
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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