-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Change Target from a CodeProperty to be an AliasProperty that points to FileSystemInfo.LinkTarget
#16165
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
src/System.Management.Automation/engine/NativeCommandProcessor.cs
Outdated
Show resolved
Hide resolved
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.
@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
@iSazonov That's not a goal of this PR :) |
|
@iSazonov I made some updates based on your comments. Please take another look when you have time, thanks! |
src/System.Management.Automation/engine/NativeCommandProcessor.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
Show resolved
Hide resolved
…oints to `FileSystemInfo.LinkTarget` (PowerShell#16165)
|
🎉 Handy links: |
|
🎉 Handy links: |
…oints to `FileSystemInfo.LinkTarget` (PowerShell#16165)
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.