Set remoting PSVersionTable private data in a downlevel compatible manner

This commit is contained in:
Jason Shirk (POWERSHELL) committed 2016-08-03 13:21:42 -07:00
1 parent 2b74b89f76
commit 2b70837d98
2 files changed
+12 -1

No files matched your search

@@ -81,6 +81,14 @@ namespace System.Management.Automation
return s_psVersionTable;
}
internal static Hashtable GetPSVersionTableForDownLevel()
{
var result = (Hashtable)s_psVersionTable.Clone();
// Downlevel systems don't support SemanticVersion, but Version is most likely good enough anyway.
result[PSVersionInfo.PSVersionName] = (Version)(SemanticVersion)s_psVersionTable[PSVersionInfo.PSVersionName];
return result;
}
internal static Version GetBuildVersion()
{
string assemblyPath = typeof(PSVersionInfo).GetTypeInfo().Assembly.Location;