-
Notifications
You must be signed in to change notification settings - Fork 8k
Use absolute path in FileSystemProvider.CreateDirectory
#24615
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
Use absolute path in FileSystemProvider.CreateDirectory
#24615
Conversation
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The .Net method Directory.CreateDirectory(path) works right only if path is absolute path, otherwise the path is considered as relative one based on system CWD.
If we call GetParentPath(path, null) the method uses a root path for current psdrive, i.e. we calculate relative path but we need absolute path.
So the call looks like a bug for all (5) code paths where the void CreateDirectory() method is used.
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
@Tadas Please press "Update with rebase" to get latest commits from master branch. |
63348d3 to
8694def
Compare
Done |
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
…stem.Tests.ps1 Co-authored-by: Ilya <darpa@yandex.ru>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
FileSystemProvider.CreateDirectoryFileSystemProvider.CreateDirectory
|
📣 Hey @@Tadas, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
|
@Tadas Thanks for your contribution! |
|
Thank you for your help 👍 |
PR Summary
Remove unnecessary path split in
FileSystemProvider.CreateDirectorybecause those parts are not used anywhere and ultimately end up being combined again for theDirectory.CreateDirectorycall.PR Context
Fixes pester/Pester#2258 :
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed:
(which runs in a different PS Host).