FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Change `Target` from a `CodeProperty` to be an `AliasProperty` that points to `FileSystemInfo.LinkTarget` by daxian-dbw · Pull Request #16165 · PowerShell/PowerShell · GitHub

Change Target from a CodeProperty to be an AliasProperty that points to FileSystemInfo.LinkTarget - #16165

Merged
Rob Holt (rjmholt) merged 7 commits into
PowerShell:masterfrom
daxian-dbw:target
Oct 5, 2021
Merged

Change Target from a CodeProperty to be an AliasProperty that points to FileSystemInfo.LinkTarget#16165
Rob Holt (rjmholt) merged 7 commits into
PowerShell:masterfrom
daxian-dbw:target

Conversation

Dongbo Wang (daxian-dbw) commented Sep 28, 2021
edited by iSazonov
Loading

Copy link
Copy Markdown
Member

PR Summary

Fix #15958
Fix #13365

Change Target from a CodeProperty to be an AliasProperty that points to FileSystemInfo.LinkTarget.
Also, keep the public API InternalSymbolicLinkLinkCodeMethods.GetTarget(PSObject instance), but use FileSystemInfo.LinkTarget inside.

I have reviewed the .NET implementation of LinkTarget, and can confirm that the functionality is in parity.
The only difference is that LinkTarget doesn't throw error when the file doesn't exist, but our GetTarget(...) 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

Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Dongbo Wang (@daxian-dbw) Since you refactor the code why not remove Platform.IsWindows() and put code under #if?

Copy link
Copy Markdown
Member Author

Since you refactor the code why not remove Platform.IsWindows() and put code under #if?

Ilya (@iSazonov) That's not a goal of this PR :)

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) I made some updates based on your comments. Please take another look when you have time, thanks!

Rob Holt (rjmholt) merged commit 2f57bf8 into PowerShell:master Oct 5, 2021
Dongbo Wang (daxian-dbw) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 5, 2021
Dongbo Wang (daxian-dbw) added a commit to daxian-dbw/PowerShell that referenced this pull request Oct 21, 2021

Copy link
Copy Markdown

🎉v7.2.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

Copy link
Copy Markdown

🎉v7.3.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

TrapGodBrim pushed a commit to TrapGodBrim/PowerShell that referenced this pull request Jan 19, 2022
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
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

Labels

Backport-7.2.x-Done CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

4 participants


Back | FazBrowse Home | New Git URL