-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Make New-Item -Force overwrite on Junction #18311
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
Conversation
|
Making this WIP as my build environment is unhappy so I'll be testing off the build artifact. 😅 |
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
|
@GigaScratch Please add a test. |
|
|
You could look |
I added a simple overwrite test, but ideally I would like a way to verify that the object created is actually new and to throw an error if it is not. |
|
You could use another target in second New-Item and check that target is changed after first command. |
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
|
@microsoft-github-policy-service agree |
1 similar comment
|
@microsoft-github-policy-service agree |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Co-authored-by: Ilya <darpa@yandex.ru>
82c5a86 to
53a65d5
Compare
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
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. Made a quick fix and rebased the branch.
|
🎉 Handy links: |
PR Summary
When performing
New-Item <itemname> -Type Junction -Value <path> -Force, it will fail with"<path> cannot be removed because it is not empty.".This has been resolved by moving the Child Item check from before force is checked, to the else condition of the force check.
PR Context
This PR aims to fix #17656.
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.(which runs in a different PS Host).