Skip to content

Commit 88ae453

Browse files
authored
Fix Get-VirtualEnvs for PS 7.0+ (#24)
* Fix typo * Get-VirtualEnvs: properly handle $child in PS 7.0+
1 parent 80c9450 commit 88ae453

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

VirtualEnvWrapper.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ function Get-VirtualEnvs {
354354
for($i = 0; $i -lt $children.Length; $i++) {
355355
$child = $children[$i]
356356
try {
357-
$PythonVersion = (((Invoke-Expression ("$WORKON_HOME\{0}\Scripts\Python.exe --version 2>&1" -f "$child")) -replace "`r|`n","") -Split " ")[1]
358-
Write-host ("`t{0,-30}{1,-15}" -f $child,$PythonVersion)
357+
$PythonVersion = (((Invoke-Expression ("$WORKON_HOME\{0}\Scripts\Python.exe --version 2>&1" -f $child.name)) -replace "`r|`n","") -Split " ")[1]
358+
Write-host ("`t{0,-30}{1,-15}" -f $child.name,$PythonVersion)
359359
} catch {
360360
$failed += $child
361361
}
@@ -365,7 +365,7 @@ function Get-VirtualEnvs {
365365
}
366366
if ($failed.Length -gt 0) {
367367
Write-Host
368-
Write-Host "`tAdditionnaly, one or more environments failed to be listed"
368+
Write-Host "`tAdditionally, one or more environments failed to be listed"
369369
Write-Host "`t=========================================================="
370370
Write-Host
371371
foreach ($item in $failed) {

0 commit comments

Comments
 (0)