We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2c2d25 commit 7098286Copy full SHA for 7098286
src/code/ServerFactory.cs
@@ -2,6 +2,7 @@
2
// Licensed under the MIT License.
3
4
using Microsoft.PowerShell.PSResourceGet.UtilClasses;
5
+using System.Collections;
6
using System.Management.Automation;
7
using System.Management.Automation.Runspaces;
8
using System.Net;
@@ -14,7 +15,7 @@ static UserAgentInfo()
14
15
{
16
using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace))
17
- _psVersion = ps.AddScript("$PSVersionTable.PSVersion.ToString()").Invoke<string>()[0];
18
+ _psVersion = ps.AddScript("$PSVersionTable").Invoke<Hashtable>()[0]["PSVersion"].ToString();
19
}
20
21
_psResourceGetVersion = typeof(UserAgentInfo).Assembly.GetName().Version.ToString();
0 commit comments