Skip to content

Properly disable (if/def out) all code related to session connection/disconnection for Unix builds #7008

Closed

Description

This issue is opened based on the comment in PR #6939.

Class QueryRunspaces and enum SessionFilterState from ConnectPSSession.cs

QueryRunspaces is only used for session disconnect, which is only supported on Windows. PSRemotingCmdlets.cs is a heavily loaded file to support many remoting cmdlet base classes. Moving QueryRunspaces there just makes it more bloated and confusing in my opinion.
I feel that QueryRunspaces should be put into a separate utils file that can be skipped for Linux.
You should also #ifdef out its use in the Get-PSSession parameter set since it is not supported on Linux.

The type QueryRunspaces is only for session connection/disconnection. It's used in Connect-PSSession/Receive-PSSession/Get-PSSession and it's also directly used by the abstract class PSRunspaceCmdlet from PSRemotingCmdlet.cs. Now Connect-PSSession and Receive-PSSession are disabled in Unix build, but QueryRunspaces is still used in Get-PSSession (in getrunspacecommand.cs) and PSRunspaceCmdlet (in PSRemotingCmdlet.cs), even though the connenction/disconnection feature is not available on Unix platforms.

So, we need to properly disable all code realted to session connection/disconnection for Unix build, and then, as Paul Higinbotham (@PaulHigin) suggested in the comment, QueryRunspaces and SessionFilterState probably should be moved a separate file that can be skipped for Unix build compilation.

Activity

  1. added
    WG-Maintainers-Build
    Issue-Code Cleanup
    on Jun 6, 2018
  2. removed their assignment
    on Oct 10, 2018
  3. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  4. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  5. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  6. added
    Resolution-No Activity
    on Nov 16, 2023
  7. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Code CleanupResolution-No ActivityWG-Maintainers-Build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions