Update 'venv list'.

This commit is contained in:
Mikaël Capelle 2022-08-25 13:39:27 +02:00
parent 3e3efc9650
commit bb2f454add

View File

@ -23,11 +23,12 @@ function venv {
$venv) $venv)
switch ($command) { switch ($command) {
"list" { "list" {
Get-ChildItem -Directory $env:WORKON_HOME @(Get-ChildItem -Directory $env:WORKON_HOME | ForEach-Object {
| ForEach-Object {
$name = $_.Name $name = $_.Name
$version = (& "$_/Scripts/python.exe" --version) $version = (& "$_/Scripts/python.exe" --version).Replace("Python ", "")
Write-Output "${name}: $version" @{Name = $name; Version = $version; Path = $_ }
}) | ForEach-Object {
New-Object object | Add-Member -NotePropertyMembers $_ -PassThru
} }
} }