Change Target from a CodeProperty to be an AliasProperty that points to FileSystemInfo.LinkTarget#16165
Merged
rjmholt merged 7 commits intoPowerShell:masterfrom Oct 5, 2021
Merged
Conversation
daxian-dbw
commented
Sep 28, 2021
src/System.Management.Automation/engine/NativeCommandProcessor.cs
Outdated
Show resolved
Hide resolved
iSazonov
reviewed
Sep 28, 2021
Collaborator
iSazonov
left a comment
There was a problem hiding this comment.
@daxian-dbw Since you refactor the code why not remove Platform.IsWindows() and put code under #if?
src/System.Management.Automation/engine/NativeCommandProcessor.cs
Outdated
Show resolved
Hide resolved
Member
Author
@iSazonov That's not a goal of this PR :) |
Member
Author
|
@iSazonov I made some updates based on your comments. Please take another look when you have time, thanks! |
iSazonov
reviewed
Sep 29, 2021
src/System.Management.Automation/engine/NativeCommandProcessor.cs
Outdated
Show resolved
Hide resolved
iSazonov
approved these changes
Sep 30, 2021
iSazonov
reviewed
Oct 2, 2021
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Outdated
Show resolved
Hide resolved
iSazonov
reviewed
Oct 2, 2021
test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
Show resolved
Hide resolved
rjmholt
approved these changes
Oct 5, 2021
13 tasks
daxian-dbw
added a commit
to daxian-dbw/PowerShell
that referenced
this pull request
Oct 21, 2021
…oints to `FileSystemInfo.LinkTarget` (PowerShell#16165)
|
🎉 Handy links: |
|
🎉 Handy links: |
TrapGodBrim
pushed a commit
to TrapGodBrim/PowerShell
that referenced
this pull request
Jan 19, 2022
…oints to `FileSystemInfo.LinkTarget` (PowerShell#16165)
22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Fix #15958
Fix #13365
Change
Targetfrom aCodePropertyto be anAliasPropertythat points toFileSystemInfo.LinkTarget.Also, keep the public API
InternalSymbolicLinkLinkCodeMethods.GetTarget(PSObject instance), but useFileSystemInfo.LinkTargetinside.I have reviewed the .NET implementation of
LinkTarget, and can confirm that the functionality is in parity.The only difference is that
LinkTargetdoesn't throw error when the file doesn't exist, but ourGetTarget(...)throws exception in that case. So, I add the file-existence check at some places, and other places doesn't need the check.It would be easier to review by ignoring the white-space changes:
https://github.com/PowerShell/PowerShell/pull/16165/files?w=1
PR Context
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.