- Notifications
You must be signed in to change notification settings - Fork8.1k
Use absolute path inFileSystemProvider.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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 methodDirectory.CreateDirectory(path) works right only ifpath is absolute path, otherwise thepath is considered as relative one based onsystem CWD.
If we callGetParentPath(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 forall (5) code paths where thevoid CreateDirectory() method is used.
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
/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 to8694defCompare
Done |
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…stem.Tests.ps1Co-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.CreateDirectoryb3bc4ff intoPowerShell:masterUh oh!
There was an error while loading.Please reload this page.
microsoft-github-policy-servicebot commentedMay 13, 2025 • edited by unfurl-linksbot
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by unfurl-linksbot
Uh oh!
There was an error while loading.Please reload this page.
📣 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
Fixespester/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).