Use absolute path in FileSystemProvider.CreateDirectory#24615
Use absolute path in FileSystemProvider.CreateDirectory#24615iSazonov merged 4 commits intoPowerShell:masterfrom
FileSystemProvider.CreateDirectory#24615Conversation
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
iSazonov
left a comment
There was a problem hiding this comment.
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).