Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Jun 28, 2018

PR Summary

Intent was to have the version of the PSSessionConfiguration name not include the v for the version string. Also, Preview releases should standardize on PowerShell.6-Preview instead of clobbering PowerShell.6 so that stable and preview can co-exist side-by-side.

Need to verify on Win10 IoT if Install-PowerShellRemoting.ps1 is still needed anymore as it may be possible to run pwsh -c enable-psremoting from within Windows PowerShell Core removing the need for that script which duplicates Enable-PSRemoting capability.

Update: Not able to get current master build working on Win10 IoT, getting Invalid access to memory error. Will have to investigate this separately from this PR and keep Install-PowerShellRemoting.ps1 for now.

Fix #7119

PR Checklist

@SteveL-MSFT SteveL-MSFT requested a review from PaulHigin June 28, 2018 18:49
@SteveL-MSFT SteveL-MSFT added the Breaking-Change breaking change that may affect users label Jun 28, 2018
// TODO: This should be PSVersionInfo.PSVersionName once we get
// closer to release. Right now it doesn't support alpha versions.
return System.String.Concat("PowerShell.", PSVersionInfo.GitCommitId);
string version = PSVersionInfo.GitCommitId;
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if both these code paths included comments with examples demonstrating what is expected. Otherwise it is a bit confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will add

if ($dotPos -ne -1) {{
$powershellVersionMajor = $powershellVersionMajor.Substring(0, $dotPos)
}}
if ($PSVersionTable.PSVersion.ToString().Contains(""preview""))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see how appending "preview" gets the Issue PowerShell.6.1.0-preview.3 endpoint name. Where does the ending ".3" come from?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add a comment

string version = PSVersionInfo.GitCommitId;
if (version.StartsWith("v"))
{
version = version.Substring(1, version.Length - 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use the simpler String.Substring(int startIndex) overload

# but instead creating a PowerShell.6-Preview endpoint
if ($PSVersionTable.PSVersion.ToString().Contains(""preview""))
{{
$powershellVersionMajor += ""-Preview""
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor note: I'm curious why we don't use the same casing for Preview as we do in the version string? In one case, we have mixed case Preview (PowerShell.6-Preview) while in the other, lower case (PowerShell.6.1.0-preview.715)

Copy link
Member Author

Choose a reason for hiding this comment

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

semver.org uses lowercase for their examples of alpha and beta releases, but I don't see any language indicating it must be lowercase. We should consider having a capital P in the semver and package name, but that's outside the scope of this PR.

Copy link
Member

Choose a reason for hiding this comment

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

capitals are not allowed in many semver. I've had to add ToLower to many places in the code to ensure we can release without error.

@SteveL-MSFT SteveL-MSFT force-pushed the enable-psremoting-name branch 3 times, most recently from a69edd0 to e293501 Compare June 29, 2018 03:55
@SteveL-MSFT SteveL-MSFT changed the title WIP: Update Enable-PSRemoting so configuration name for Preview releases Update Enable-PSRemoting so configuration name for Preview releases Jun 29, 2018
fix JEA tests
@SteveL-MSFT SteveL-MSFT force-pushed the enable-psremoting-name branch from e293501 to aa6b5ce Compare June 29, 2018 05:30
shellName += "-Preview";
}

return shellName;
Copy link
Collaborator

@iSazonov iSazonov Jun 29, 2018

Choose a reason for hiding this comment

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

We build GitCommitId in PSVersionInfo - so maybe build the shellName there too? This can simplify the script below too. And tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

@iSazonov that's a great suggestion. The alternative is that we add the v to install-powershellremoting.ps1 for the version specific endpoint to make it predictable but inconsistent with the generic 6 and 6-preview endpoints. Let's discuss this in the issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding or removing v to preview isn't problem but breaking change for release. I believe it is better to use the same code for both versions and the same formatting for both endpoint names.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that it is better to fix the preview version - this is acceptable for version update 6.0 -> 6.1.

@SteveL-MSFT SteveL-MSFT changed the title Update Enable-PSRemoting so configuration name for Preview releases WIP: Update Enable-PSRemoting so configuration name for Preview releases Jun 29, 2018
Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

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

LGTM

@SteveL-MSFT SteveL-MSFT changed the title WIP: Update Enable-PSRemoting so configuration name for Preview releases Update Enable-PSRemoting so configuration name for Preview releases Jul 16, 2018
@SteveL-MSFT SteveL-MSFT force-pushed the enable-psremoting-name branch 3 times, most recently from cdcd180 to dab083b Compare July 16, 2018 22:26
based on PS-Committee discussion, decision is to remove `v` from GitCommitId
@SteveL-MSFT SteveL-MSFT force-pushed the enable-psremoting-name branch from dab083b to 36954a5 Compare July 16, 2018 23:21
Copy link
Collaborator

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

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

LGTM!

internal static string GetWinrmPluginShellName()
{
// PowerShell Core uses a versioned directory to hold the plugin
// TODO: This should be PSVersionInfo.PSVersionName once we get
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the removal of this TODO mean we no longer intend for this to happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removal of this comment means that the current design supports semver (pre-release labels)

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

LGTM. Left a non-blocking comment.

}}
# If we are running a Preview version, we don't want to clobber the generic PowerShell.6 endpoint
# but instead creating a PowerShell.6-Preview endpoint
if ($PSVersionTable.PSVersion.ToString().Contains(""preview""))
Copy link
Member

Choose a reason for hiding this comment

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

nit: Maybe checking !string.IsNullOrEmpty($PSVersionTable.PSVersion.PreReleaseLabel) is slightly better.
This is not a blocking comment.

Copy link
Member

Choose a reason for hiding this comment

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

Just realized it's in script, then even simpler: if ($PSVersionTable.PSVersion.PreReleaseLabel)

Copy link
Member Author

@SteveL-MSFT SteveL-MSFT Jul 17, 2018

Choose a reason for hiding this comment

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

One concern is that the current proposal for corefx for SemanticVersion type has a different member: https://github.com/dotnet/corefx/issues/13526

Eventually, we'll want to move to the corefx SemanticVersion type. I'll change it now and we'll update the code base later to adopt SemanticVersion.

Copy link
Member

Choose a reason for hiding this comment

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

I'll change it now and we'll update the code base later to adopt SemanticVersion.

That sounds great!

Copy link
Collaborator

Choose a reason for hiding this comment

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

@SteveL-MSFT Maybe open tracking issue for moving to the corefx SemanticVersion type?

address Dongbo's feedback
@TravisEz13 TravisEz13 merged commit 0a2f9c8 into PowerShell:master Jul 17, 2018
TravisEz13 pushed a commit that referenced this pull request Jul 17, 2018
…#7202)

The intent was to have the version of the PSSessionConfiguration name not include the `v` for the version string.  Also, Preview releases should standardize on `PowerShell.6-Preview` instead of clobbering `PowerShell.6` so that stable and preview can co-exist side-by-side.

Need to verify on Win10 IoT if `Install-PowerShellRemoting.ps1` is still needed anymore as it may be possible to run `pwsh -c enable-psremoting` from within Windows PowerShell Core removing the need for that script which duplicates `Enable-PSRemoting` capability.

Update: Not able to get the current master build working on Win10 IoT, getting `Invalid access to memory` error.  Will have to investigate this separately from this PR and keep `Install-PowerShellRemoting.ps1` for now.

Fix #7119
@SteveL-MSFT SteveL-MSFT deleted the enable-psremoting-name branch July 17, 2018 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

8 participants