mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 19:09:13 +01:00
Improve list-tiobe-index.ps1
This commit is contained in:
parent
fc5176ca32
commit
7ff639999d
@ -1,21 +1,21 @@
|
|||||||
Language, Popularity, Change
|
Language, Popularity, Change
|
||||||
C, 12.54, -4.65%
|
C, 12.54, -4.65
|
||||||
Python, 11.84, +3.48%
|
Python, 11.84, +3.48
|
||||||
Java, 11.54, -4.56%
|
Java, 11.54, -4.56
|
||||||
C++, 7.36, +1.41%
|
C++, 7.36, +1.41
|
||||||
C#, 4.33, -0.40%
|
C#, 4.33, -0.40
|
||||||
Visual Basic, 4.01, -0.68%
|
Visual Basic, 4.01, -0.68
|
||||||
JavaScript, 2.33, +0.06%
|
JavaScript, 2.33, +0.06
|
||||||
PHP, 2.21, -0.05%
|
PHP, 2.21, -0.05
|
||||||
Assembly language, 2.05, +1.09%
|
Assembly language, 2.05, +1.09
|
||||||
SQL, 1.88, +0.15%
|
SQL, 1.88, +0.15
|
||||||
Classic Visual Basic, 1.72, +1.07%
|
Classic Visual Basic, 1.72, +1.07
|
||||||
Groovy, 1.29, +0.87%
|
Groovy, 1.29, +0.87
|
||||||
Ruby, 1.23, +0.25%
|
Ruby, 1.23, +0.25
|
||||||
R, 1.20, -0.99%
|
R, 1.20, -0.99
|
||||||
Perl, 1.18, +0.36%
|
Perl, 1.18, +0.36
|
||||||
Swift, 1.10, -0.35%
|
Swift, 1.10, -0.35
|
||||||
Fortran, 1.07, +0.80%
|
Fortran, 1.07, +0.80
|
||||||
Delphi/Object Pascal, 1.06, +0.47%
|
Delphi/Object Pascal, 1.06, +0.47
|
||||||
MATLAB, 1.05, +0.15%
|
MATLAB, 1.05, +0.15
|
||||||
Go, 0.95, -0.06%
|
Go, 0.95, -0.06
|
||||||
|
|
@ -5,7 +5,7 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
function WriteBar { param([string]$Text, [float]$Value, [float]$Max, [string]$Hint)
|
function WriteBar { param([string]$Text, [float]$Value, [float]$Max, [float]$Change)
|
||||||
$Num = ($Value * 70.0) / $Max
|
$Num = ($Value * 70.0) / $Max
|
||||||
while ($Num -ge 1.0) {
|
while ($Num -ge 1.0) {
|
||||||
write-host -noNewLine "█"
|
write-host -noNewLine "█"
|
||||||
@ -26,7 +26,12 @@ function WriteBar { param([string]$Text, [float]$Value, [float]$Max, [string]$Hi
|
|||||||
} elseif ($Num -ge 0.125) {
|
} elseif ($Num -ge 0.125) {
|
||||||
write-host -noNewLine "▏"
|
write-host -noNewLine "▏"
|
||||||
}
|
}
|
||||||
" $Text $($Value)% ($Hint)"
|
write-host -noNewLine " $Text $($Value)%"
|
||||||
|
if ($Change -ge 0.0) {
|
||||||
|
write-host -foregroundColor green " +$($Change)%"
|
||||||
|
} else {
|
||||||
|
write-host -foregroundColor red " $($Change)%"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -37,8 +42,8 @@ try {
|
|||||||
foreach($Row in $Table) {
|
foreach($Row in $Table) {
|
||||||
[string]$Name = $Row.Language
|
[string]$Name = $Row.Language
|
||||||
[float]$Value = $Row.Popularity
|
[float]$Value = $Row.Popularity
|
||||||
[string]$Hint = $Row.Change
|
[float]$Change = $Row.Change
|
||||||
WriteBar $Name $Value 14.0 $Hint
|
WriteBar $Name $Value 14.0 $Change
|
||||||
}
|
}
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user