mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 14:18:38 +01:00
Add list-tiobe-index.ps1
This commit is contained in:
parent
ee03928841
commit
3aa8df2cef
21
Data/TIOBE-index.csv
Normal file
21
Data/TIOBE-index.csv
Normal file
@ -0,0 +1,21 @@
|
||||
Language, Popularity, Change
|
||||
C, 12.54, -4.65%
|
||||
Python, 11.84, +3.48%
|
||||
Java, 11.54, -4.56%
|
||||
C++, 7.36, +1.41%
|
||||
C#, 4.33, -0.40%
|
||||
Visual Basic, 4.01, -0.68%
|
||||
JavaScript, 2.33, +0.06%
|
||||
PHP, 2.21, -0.05%
|
||||
Assembly language, 2.05, +1.09%
|
||||
SQL, 1.88, +0.15%
|
||||
Classic Visual Basic, 1.72, +1.07%
|
||||
Groovy, 1.29, +0.87%
|
||||
Ruby, 1.23, +0.25%
|
||||
R, 1.20, -0.99%
|
||||
Perl, 1.18, +0.36%
|
||||
Swift, 1.10, -0.35%
|
||||
Fortran, 1.07, +0.80%
|
||||
Delphi/Object Pascal, 1.06, +0.47%
|
||||
MATLAB, 1.05, +0.15%
|
||||
Go, 0.95, -0.06%
|
|
@ -123,6 +123,7 @@ list-tags.ps1, lists all tags in the current/given Git repository
|
||||
list-tasks.ps1, lists all Windows scheduler tasks
|
||||
list-timezone.ps1, lists the current time zone details
|
||||
list-timezones.ps1, lists all time zones available
|
||||
list-tiobe-index.ps1, lists the TIOBE index of top programming languages
|
||||
list-user-groups.ps1, lists the user groups on the local computer
|
||||
list-weather.ps1, lists the hourly weather
|
||||
list-workdir.ps1, lists the current working directory
|
||||
|
|
@ -203,6 +203,7 @@ Mega Collection of PowerShell Scripts
|
||||
* [list-random-passwords.ps1](Scripts/list-random-passwords.ps1) - prints a list of random passwords
|
||||
* [list-random-pins.ps1](Scripts/list-random-pins.ps1) - prints a list of random PIN's
|
||||
* [list-sql-tables.ps1](Scripts/list-sql-tables.ps1) - lists the SQL server tables
|
||||
* [list-tiobe-index.ps1](Scripts/list-tiobe-index.ps1) - lists the TIOBE index of top programming languages
|
||||
* [list-weather.ps1](Scripts/list-weather.ps1) - lists the hourly weather
|
||||
* [locate-city.ps1](Scripts/locate-city.ps1) - prints the geographic location of the given city
|
||||
* [locate-ipaddress.ps1](Scripts/locate-ipaddress.ps1) - prints the geographic location of the given IP address
|
||||
|
47
Scripts/list-tiobe-index.ps1
Normal file
47
Scripts/list-tiobe-index.ps1
Normal file
@ -0,0 +1,47 @@
|
||||
<#
|
||||
.SYNTAX list-tiobe-index.ps1
|
||||
.DESCRIPTION lists the TIOBE index of top programming languages
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
function WriteBar { param([string]$Text, [float]$Value, [float]$Max, [string]$Hint)
|
||||
$Num = ($Value * 70.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 "▏"
|
||||
}
|
||||
" $Text $($Value)% ($Hint)"
|
||||
}
|
||||
|
||||
try {
|
||||
& write-big.ps1 "TIOBE INDEX 2021-06"
|
||||
""
|
||||
|
||||
$Table = import-csv "$PSScriptRoot/../Data/TIOBE-index.csv"
|
||||
foreach($Row in $Table) {
|
||||
[string]$Name = $Row.Language
|
||||
[float]$Value = $Row.Popularity
|
||||
[string]$Hint = $Row.Change
|
||||
WriteBar $Name $Value 14.0 $Hint
|
||||
}
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user