@@ -21,12 +21,6 @@ internal class PowerShellVersionDetails
21
21
/// </summary>
22
22
public Version Version { get ; }
23
23
24
- /// <summary>
25
- /// Gets the full version string, either the ToString of the Version
26
- /// property or the GitCommitId for open-source PowerShell releases.
27
- /// </summary>
28
- public string VersionString { get ; }
29
-
30
24
/// <summary>
31
25
/// Gets the PowerShell edition (generally Desktop or Core).
32
26
/// </summary>
@@ -36,15 +30,12 @@ internal class PowerShellVersionDetails
36
30
/// Creates an instance of the PowerShellVersionDetails class.
37
31
/// </summary>
38
32
/// <param name="version">The version of the PowerShell runtime.</param>
39
- /// <param name="versionString">A string representation of the PowerShell version.</param>
40
33
/// <param name="editionString">The string representation of the PowerShell edition.</param>
41
34
public PowerShellVersionDetails (
42
35
Version version ,
43
- string versionString ,
44
36
string editionString )
45
37
{
46
38
Version = version ;
47
- VersionString = versionString ;
48
39
Edition = editionString ;
49
40
}
50
41
@@ -59,7 +50,6 @@ public PowerShellVersionDetails(
59
50
public static PowerShellVersionDetails GetVersionDetails ( ILogger logger , PowerShell pwsh )
60
51
{
61
52
Version powerShellVersion = new ( 5 , 0 ) ;
62
- string versionString = null ;
63
53
string powerShellEdition = "Desktop" ;
64
54
65
55
try
@@ -89,8 +79,6 @@ public static PowerShellVersionDetails GetVersionDetails(ILogger logger, PowerSh
89
79
// Expected version string format is 6.0.0-alpha so build a simpler version from that
90
80
powerShellVersion = new Version ( version . ToString ( ) . Split ( '-' ) [ 0 ] ) ;
91
81
}
92
-
93
- versionString = psVersionTable [ "GitCommitId" ] is string gitCommitId ? gitCommitId : powerShellVersion . ToString ( ) ;
94
82
}
95
83
}
96
84
catch ( Exception ex )
@@ -99,7 +87,7 @@ public static PowerShellVersionDetails GetVersionDetails(ILogger logger, PowerSh
99
87
"Failed to look up PowerShell version, defaulting to version 5.\r \n \r \n " + ex . ToString ( ) ) ;
100
88
}
101
89
102
- return new PowerShellVersionDetails ( powerShellVersion , versionString , powerShellEdition ) ;
90
+ return new PowerShellVersionDetails ( powerShellVersion , powerShellEdition ) ;
103
91
}
104
92
}
105
93
}
0 commit comments