mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Set remoting PSVersionTable private data in a downlevel compatible manner
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user