PowerShell/Scripts/write-chart.ps1

34 lines
677 B
PowerShell
Raw Normal View History

2021-06-01 16:44:28 +02:00
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