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

Appearance settings

Review all if/def and Unix specific code after moving to .NET Core 2.0 #3565

Copy link
Copy link
@daxian-dbw

Description

@daxian-dbw
Issue body actions

PowerShell Core is moving to .NET Core 2.0 with PR #3556. Once that PR is merged, we need to review all if/def and Unix specific code to:

  • Clean up the code
  • Make sure the code make sense and is not a temporary hack

An Example (Please remove when fixed)

Platform.InternalGetFolderPath in src/System.Management.Automation/CoreCLR/CorePsPlatform.cs has the following code:

                case System.Environment.SpecialFolder.ProgramFiles:
                    folderPath = "/bin";
                    if (!System.IO.Directory.Exists(folderPath)) { folderPath = null; }
                    break;
                case System.Environment.SpecialFolder.ProgramFilesX86:
                    folderPath = "/usr/bin";
                    if (!System.IO.Directory.Exists(folderPath)) { folderPath = null; }
                    break;
                case System.Environment.SpecialFolder.System:
                case System.Environment.SpecialFolder.SystemX86:
                    folderPath = "/sbin";
                    if (!System.IO.Directory.Exists(folderPath)) { folderPath = null; }
                    break;

It use /bin for ProgramFiles, /usr/bin for ProgramFilesX86 and /sbin for System and SystemX86. It's not clear if this is appropriate, so code like this should be reviewed.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.