Skip to content

Get-PSSession with -ComputerName or with -connectionUri does not work #6321

Closed

Description

@sh0375

Steps to reproduce

1. launch pwsh
2. execute command: Get-PSSession -ComputerName "localhost"

Expected behavior

as descibed here: 
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/get-pssession?view=powershell-6

Actual behavior

Get-PSSession : The term 'New-WSManSessionOption' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-PSSession -ComputerName "localhost"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (New-WSManSessionOption:String) [Get-PSSession], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetPSSessionCommand

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Linux 3.13.0-141-generic #190-Ubuntu SMP Fri Jan 19 12:52:38 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. ThomasNieto commented on Aug 7, 2020

    @ThomasNieto
    Contributor

    Is this still an issue?

  2. neatchee commented on Mar 9, 2021

    @neatchee

    Thomas Nieto (@ThomasNieto) I can confirm that this is still an issue.

  3. danielbrowne commented on May 18, 2021

    @danielbrowne

    Also experiencing this issue.

    PS /scripts> $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      7.2.0-preview.3
    PSEdition                      Core
    GitCommitId                    7.2.0-preview.3
    OS                             Linux 4.15.0-142-generic #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021
    Platform                       Unix
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  4. srmo commented on Sep 30, 2021

    @srmo

    Same here

    $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      7.1.4
    PSEdition                      Core
    GitCommitId                    7.1.4
    OS                             Darwin 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RE…
    Platform                       Unix
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  5. uc-cjdavis commented on Mar 23, 2022

    @uc-cjdavis

    Still an issue

    PS /Users/cjdavis/.securityScriptsDevelopment> $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      7.2.2
    PSEdition                      Core
    GitCommitId                    7.2.2
    OS                             Darwin 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64
    Platform                       Unix
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  6. added
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    WG-RemotingPSRP issues with any transport layer
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Mar 24, 2022
  7. added
    Issue-BugIssue has been identified as a bug in the product
    and removed
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Apr 7, 2022
  8. PaulHigin commented on Apr 7, 2022

    @PaulHigin
    Contributor

    @WG-Remoting
    Remoting working group: This is a bug and Get-PSSession command needs to be updated to work correctly on non-Windows platforms. Even though WinRM/OMI is no longer available, SSH remoting still works on non-Windows platforms, and the new custom remoting connection support (#16923) now allows third-party modules that create PSSession objects, which should be discoverable through the Get-PSSession command.

  9. andreyfabrikant commented on Feb 20, 2024

    @andreyfabrikant

    Still a bug

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-BugIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreWG-RemotingPSRP issues with any transport layer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions