Update 'venv list'.
This commit is contained in:
parent
3e3efc9650
commit
bb2f454add
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user