mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 17:14:28 +01:00
34 lines
677 B
PowerShell
34 lines
677 B
PowerShell
|
|
||
|
|
||
|
|
||
|
|
||
|
function DrawBar { param([string]$Name, [float]$Value)
|
||
|
write-host -noNewLine "$($Name): "
|
||
|
$Num = $Value
|
||
|
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 " $($Value)%"
|
||
|
}
|
||
|
|
||
|
"2021 Wins"
|
||
|
DrawBar "Markus" 6.5
|
||
|
DrawBar "Andrea" 3.9
|
||
|
exit 0
|