-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Get '$PSVersionTable.PSVersion' from ProductVersion attribute #4863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7e0e6ad
Get 'PSVersion' from ProductVersion attribute
iSazonov c3bc0b8
Replace versionTable["GitCommitId"] with PSVersionInfo.GitCommitId
iSazonov 16fe5da
Split GitCommitId on formatted and non-formatted
iSazonov 04ef450
Remove 'powershell.version' file
iSazonov 8c29037
Fix Enable-PSRemoting
iSazonov 38b9827
Fix test
iSazonov b8a83fa
Add test
iSazonov 0a15f55
Revert "Fix test"
iSazonov ce1ed51
Revert "Fix Enable-PSRemoting"
iSazonov 5ec4f94
Revert "Split GitCommitId on formatted and non-formatted"
iSazonov b57f457
Improve tests
iSazonov b85ca57
Reconstruct raw GitCommitId
iSazonov fbc35bd
Minor fixes
iSazonov 9f93ebe
Remove unused code
iSazonov 9f740fa
Correct comment and add local variable
iSazonov ad92e3c
Fix GitCommitId, comments and tests
iSazonov f469c0e
Minor fixes to the comments
daxian-dbw 2dbf568
Use $PSHome in tests
iSazonov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace versionTable["GitCommitId"] with PSVersionInfo.GitCommitId
- Loading branch information
commit c3bc0b834f82e8242053634b360416a0c9b636bd
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,7 +132,7 @@ function Register-PSSessionConfiguration | |
| $pluginWsmanRunAsUserPath = [System.IO.Path]::Combine(""WSMan:\localhost\Plugin"", ""$pluginName"", ""RunAsUser"") | ||
| set-item -WarningAction SilentlyContinue $pluginWsmanRunAsUserPath $runAsCredential -confirm:$false | ||
| }} catch {{ | ||
|
|
||
| remove-item (Join-Path WSMan:\localhost\Plugin ""$pluginName"") -recurse -force | ||
| write-error $_ | ||
| # Do not add anymore clean up code after Write-Error, because if EA=Stop is set by user | ||
|
|
@@ -1564,7 +1564,7 @@ internal static string GetWinrmPluginShellName() | |
| Hashtable versionTable = PSVersionInfo.GetPSVersionTable(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
| // 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.", (string)versionTable["GitCommitId"]); | ||
| return System.String.Concat("PowerShell.", PSVersionInfo.GitCommitId); | ||
| } | ||
|
|
||
| /// <summary> | ||
|
|
@@ -1577,7 +1577,7 @@ internal static string GetWinrmPluginDllPath() | |
| Hashtable versionTable = PSVersionInfo.GetPSVersionTable(); | ||
| // TODO: This should be PSVersionInfo.PSVersionName once we get | ||
| // closer to release. Right now it doesn't support alpha versions. | ||
| string pluginDllDirectory = System.IO.Path.Combine("%windir%\\system32\\PowerShell", (string)versionTable["GitCommitId"]); | ||
| string pluginDllDirectory = System.IO.Path.Combine("%windir%\\system32\\PowerShell", PSVersionInfo.GitCommitId); | ||
| return System.IO.Path.Combine(pluginDllDirectory, RemotingConstants.PSPluginDLLName); | ||
| } | ||
|
|
||
|
|
@@ -2555,7 +2555,7 @@ function Unregister-PSSessionConfiguration | |
| return | ||
| }} | ||
| }} | ||
|
|
||
| $shellsFound++ | ||
|
|
||
| $shouldProcessTargetString = $targetTemplate -f $_.Name | ||
|
|
@@ -2779,12 +2779,12 @@ function ExtractPluginProperties([string]$pluginDir, $objectToWriteTo) | |
| }} | ||
|
|
||
| Get-Details $pluginDir $h | ||
|
|
||
| # Workflow is not supported in PowerShell Core. Attempting to load the | ||
| # assembly results in a FileNotFoundException. | ||
| if (![System.Management.Automation.Platform]::IsCoreCLR -AND | ||
| $h[""AssemblyName""] -eq ""Microsoft.PowerShell.Workflow.ServiceCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"") {{ | ||
|
|
||
| $serviceCore = [Reflection.Assembly]::Load(""Microsoft.Powershell.Workflow.ServiceCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"") | ||
|
|
||
| if ($null -ne $serviceCore) {{ | ||
|
|
@@ -4967,7 +4967,7 @@ function Enable-PSRemoting | |
| }} | ||
| }} | ||
| }} | ||
|
|
||
| # remove the 'network deny all' tag | ||
| Get-PSSessionConfiguration -Force:$Force | ForEach-Object {{ | ||
| $sddl = $null | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems
versionTableis not used anymore. This line can be removed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
I see TODO comment - currently we can detect that we use 'Release Tag' and automate the name selection. Make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand the intention of this comment. Maybe we should open an issue to track it (fix or remove).