diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellDetection.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellDetection.cs index 3787a7cc1f..f2643f1432 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellDetection.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellDetection.cs @@ -19,19 +19,20 @@ namespace ICSharpCode.PackageManagement.Scripting public bool IsPowerShell2Installed() { if (!installed.HasValue) { - CheckIfPowerShell2IsInstalled(); + installed = CheckIfPowerShell2IsInstalled(); } return installed.Value; } - void CheckIfPowerShell2IsInstalled() + bool CheckIfPowerShell2IsInstalled() { RegistryKey key = OpenPowerShellRegistryKey(); if (key != null) { using (key) { - installed = IsPowerShell2Installed(key); + return IsPowerShell2Installed(key); } } + return false; } RegistryKey OpenPowerShellRegistryKey()