Skip to content

Enable-PSRemoting and Install-PowerShellRemoting.ps1 create version specific endpoints with different names #7119

Closed

Description

Steps to reproduce

  1. Run elevated pwsh.exe

  2. Unregister any existing PowerShell Core remoting endpoint

Get-PSSessionConfiguration | Unregister-PSSessionConfiguration
  1. Run Install-PowerShellRemoting.ps1 from $PSHome
& $PSHome\Install-PowerShellRemoting.ps1
  1. List the remoting endpoints
Get-PSSessionConfiguration | ft name
  1. Unregister any existing PowerShell Core remoting endpoint from step 2
Get-PSSessionConfiguration | Unregister-PSSessionConfiguration
  1. Run Enable-PSRemoting cmdlet
Enable-PSRemoting
  1. List the remoting endpoints
Get-PSSessionConfiguration | ft name

Expected behavior

After steps 3 and 5, the endpoint names should be same:

  • PowerShell.6
  • PowerShell.6.1.0-preview.3

Actual behavior

Endpoint names are different after steps 3 and 5

After Step 3

  • PowerShell.6
  • PowerShell.6.1.0-preview.3

After Step 5

  • PowerShell.6
  • PowerShell.v6.1.0-preview.3 (extra 'v' before version number)

Activity

  1. added
    WG-Remoting
    on Jun 19, 2018
  2. HemantMahawar commented on Jun 28, 2018

    @HemantMahawar
    ContributorAuthor
  3. SteveL-MSFT commented on Jun 28, 2018

    @SteveL-MSFT
    Member

    Thought this was already fixed. I'll also fix it so that for Preview releases, it'll be PowerShell.6-Preview. I also wonder if we need to keep Install-PowerShellRemoting.ps1 as the only use different from Enable-PSRemoting is supporting specifying the location of PowerShell different than the running PowerShell, but I think you can just do:

    pwsh -c enable-psremoting

    Need to verify that works on Win10 IoT where you've had to use Install-PowerShellRemoting.ps1

  4. SteveL-MSFT commented on Jun 29, 2018

    @SteveL-MSFT
    Member

    Ilya (@iSazonov) brought up a good issue, currently if you run Enable-PSRemoting or Install-PowerShellRemoting.ps1 we setup the generic endpoint PowerShell.6 as well as the version specific endpoint PowerShell.v6.1.0-blah (using Enable-PSRemoting) or PowerShell.6.1.0-blah (using Install-PowerShellRemoting.ps1). Intent of this issue was to have Enable-PSRemoting and Install-PowerShellRemoting.ps1 standardize on the non v naming of the version specific endpoint to match the generic one.

    However, the end result is that every script that wants to use the version specific one needs to apply the same formula:

    "PowerShell." + $PSVersionTable.GitCommitId.ToString().SubString(1)

    This strips the v. It seems we should simplify this to make it predictable for automation. Options:

    1. Change PSVersionTable.GitCommitId to not start with a v (then we have to decide whether on pwsh start we emit "PowerShell v" or just "PowerShell "
    2. Add a new ShellName or EndpointName property to PSVersionTable that is exactly the same as the version specific endpoint
    3. Update Install-PowerShellRemoting.ps1 to put back the v so it's consistent with GitCommitId but inconsistent with PSVersion

    Personally, I don't think we need the v at all so I'd go with option 1.

  5. added
    Review - Committee
    on Jun 29, 2018
  6. SteveL-MSFT commented on Jul 11, 2018

    @SteveL-MSFT
    Member

    @PowerShell/powershell-committee reviewed this and would prefer to drop the v from GitCommitId and have the version specific endpoint match GitCommitId. Travis Plunk (@TravisEz13) can you verify that there is no functional/packaging concern with removing the v?

  7. added
    Committee-Reviewed
    and removed
    Review - Committee
    on Jul 12, 2018
  8. SteveL-MSFT commented on Jul 16, 2018

    @SteveL-MSFT
    Member

    I talked to Travis Plunk (@TravisEz13) and he's not aware of any reason the v is necessary. I'll update the PR to standardize on no v.

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

Metadata

Metadata

Labels

Committee-ReviewedResolution-FixedWG-Remoting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions