Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@Tadas
Copy link
Contributor

PR Summary

Remove unnecessary path split inFileSystemProvider.CreateDirectory because those parts are not used anywhere and ultimately end up being combined again for theDirectory.CreateDirectory call.

PR Context

Fixespester/Pester#2258 :

When invoking the New-Item cmdlet with a path of TestDrive:\ -Force during a test, a new folder in the current working directory with the name of the guid of the TestDrive: provider is created.

PR Checklist

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot added the Review - NeededThe PR is being reviewed labelDec 7, 2024
@TadasTadas requested a review fromiSazonovFebruary 1, 2025 09:29
@iSazonoviSazonov requested review fromSteveL-MSFT and removed request foranmenagaFebruary 1, 2025 17:28
@iSazonoviSazonov added the CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log labelFeb 1, 2025
@iSazonoviSazonov self-assigned thisFeb 1, 2025
@microsoft-github-policy-servicemicrosoft-github-policy-servicebot removed the Review - NeededThe PR is being reviewed labelFeb 1, 2025
iSazonov
iSazonov previously approved these changesFeb 7, 2025
Copy link
Collaborator

@iSazonoviSazonov left a 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.

@iSazonov
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@iSazonov
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@iSazonoviSazonov self-requested a reviewApril 23, 2025 11:29
@iSazonov
Copy link
Collaborator

@Tadas Please press "Update with rebase" to get latest commits from master branch.

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot removed the Review - NeededThe PR is being reviewed labelMay 8, 2025
@TadasTadasforce-pushed thenew-item-force-drive-root-fix branch from63348d3 to8694defCompareMay 8, 2025 14:48
@Tadas
Copy link
ContributorAuthor

@Tadas Please press "Update with rebase" to get latest commits from master branch.

Done

…stem.Tests.ps1Co-authored-by: Ilya <darpa@yandex.ru>
@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonoviSazonov changed the titleRemove unnecessary path split inFileSystemProvider.CreateDirectoryUse absolute path inFileSystemProvider.CreateDirectoryMay 13, 2025
@iSazonoviSazonov merged commitb3bc4ff intoPowerShell:masterMay 13, 2025
37 checks passed
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-servicebot commentedMay 13, 2025
edited by unfurl-linksbot
Loading

📣 Hey @@Tadas, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗https://aka.ms/PSRepoFeedback

@iSazonov
Copy link
Collaborator

@Tadas Thanks for your contribution!

Tadas reacted with hooray emoji

@Tadas
Copy link
ContributorAuthor

Thank you for your help 👍

iSazonov reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@iSazonoviSazonoviSazonov approved these changes

@SteveL-MSFTSteveL-MSFTAwaiting requested review from SteveL-MSFT

Assignees

@iSazonoviSazonov

Labels

CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

TestDrive:\ provided to New-Item creates folder in current working directory

2 participants

@Tadas@iSazonov

[8]ページ先頭

©2009-2025 Movatter.jp