-
-
Notifications
You must be signed in to change notification settings - Fork 546
Expand file tree
/
Copy pathlist-tiobe-index.ps1
More file actions
executable file
·67 lines (64 loc) · 1.8 KB
/
list-tiobe-index.ps1
File metadata and controls
executable file
·67 lines (64 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<#
.SYNOPSIS
Lists the TIOBE index
.DESCRIPTION
This PowerShell script lists the TIOBE index of top programming languages.
.EXAMPLE
PS> ./list-tiobe-index.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
function WriteBar { param([string]$text, [float]$value, [float]$max, [float]$change)
$num = ($value * 100.0) / $max
while ($num -ge 1.0) {
Write-Host "█" -noNewline
$num -= 1.0
}
if ($num -ge 0.875) {
Write-Host "▉" -noNewline
} elseif ($num -ge 0.75) {
Write-Host "▊" -noNewline
} elseif ($num -ge 0.625) {
Write-Host "▋" -noNewline
} elseif ($num -ge 0.5) {
Write-Host "▌" -noNewline
} elseif ($num -ge 0.375) {
Write-Host "▍" -noNewline
} elseif ($num -ge 0.25) {
Write-Host "▎" -noNewline
} elseif ($num -ge 0.125) {
Write-Host "▏" -noNewline
}
Write-Host " $text $($value)%" -noNewline
if ($change -ge 0.0) {
Write-Host -foregroundColor green " +$($change)%"
} else {
Write-Host -foregroundColor red " $($change)%"
}
}
try {
Write-Host ""
Write-Host ""
Write-Host "`t`t`t`tTIOBE Index for November 2025"
Write-Host "`t`t`t`t============================="
Write-Host ""
$table = Import-CSV "$PSScriptRoot/data/TIOBE-index.csv"
foreach($row in $table) {
[string]$rank = "{0,2}" -f $row.RANK
[string]$language = "{0,-20}" -f $row.LANGUAGE
[float]$popularity = $row.POPULARITY
[float]$change = $row.CHANGE
Write-Host "$($rank). $language" -noNewline
WriteBar "" $popularity 30.0 $change
}
Write-Host ""
Write-Host "Source: " -noNewline
Write-Host "https://tiobe.com/tiobe-index/" -foregroundColor blue -noNewline
Write-Host " (<Ctrl> <Click> to open the link in your browser)"
exit 0 # success
} catch {
"⚠️ ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}