File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -128,14 +128,13 @@ function Get-Python {
128128 process {
129129 $versions = New-Object System.Collections.Generic.List[PSObject ]
130130
131- $nativeKeys = Get-ChildItem - Path Registry::HKLM\Software\Python\PythonCore\ - ErrorAction " SilentlyContinue"
132- foreach ($key in $nativeKeys ) {
133- $versions.Add ((createCPythonVersion $key ))
134- }
131+ [Microsoft.Win32.RegistryKey []]$regKeys = Get-ChildItem - Path Registry::HKLM\Software\Python\PythonCore\ - ErrorAction " SilentlyContinue"
132+ [Microsoft.Win32.RegistryKey []]$regKeys = $regKeys + (Get-ChildItem - Path Registry::HKLM\SOFTWARE\Wow6432Node\Python\PythonCore\ - ErrorAction " SilentlyContinue" )
135133
136- $wowKeys = Get-ChildItem - Path Registry::HKLM\SOFTWARE\Wow6432Node\Python\PythonCore\ - ErrorAction " SilentlyContinue"
137- foreach ($key in $wowKeys ) {
138- $versions.Add ((createCPythonVersion $key ))
134+ foreach ($key in $regKeys ) {
135+ if (Test-Path (" Registry::" + (Join-Path $key.Name " \InstallPath" ))) {
136+ $versions.Add ((createCPythonVersion $key ))
137+ }
139138 }
140139
141140 ($versions |
You can’t perform that action at this time.
0 commit comments