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 90c25b2 commit 0f59954Copy full SHA for 0f59954
src/Commands/Utilities/PSUtility.cs
@@ -39,13 +39,13 @@ internal class PSUtility
39
#pragma warning disable CA1416 // Validate platform compatibility
40
public static bool IsUserLocalAdmin()
41
{
42
- if (OperatingSystem.IsWindows())
+ if (OperatingSystem.IsWindows() && PSVersion == "7.5")
43
44
using var identity = System.Security.Principal.WindowsIdentity.GetCurrent();
45
var principal = new System.Security.Principal.WindowsPrincipal(identity);
46
var isAdmin = principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator);
47
48
- return isAdmin && PSVersion == "7.5";
+ return isAdmin;
49
}
50
return true;
51
0 commit comments