PowerShell/Scripts/simulate-matrix.ps1

53 lines
2.2 KiB
PowerShell
Raw Normal View History

2021-02-09 19:30:45 +01:00
#!/bin/powershell
2020-12-29 15:14:21 +01:00
<#
.SYNTAX ./simulate-matrix.ps1
.DESCRIPTION simulates the Matrix (fun)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
2020-12-15 15:21:50 +01:00
2021-01-02 11:08:59 +01:00
$PathToRepo = "$PSScriptRoot/.."
2020-12-15 15:21:50 +01:00
try {
2020-12-29 15:48:24 +01:00
write-progress "Reading Data/matrix.csv..."
$Table = import-csv "$PathToRepo/Data/matrix.csv"
2020-12-15 15:21:50 +01:00
2020-12-29 15:14:21 +01:00
clear-host
2020-12-15 15:21:50 +01:00
foreach($Row in $Table) {
for ($i = 0; $i -lt 4; $i++) {
2020-12-29 15:14:21 +01:00
write-host -nonewline $($Row.A); start-sleep -milliseconds 5
write-host -nonewline $($Row.B); start-sleep -milliseconds 5
write-host -nonewline $($Row.C); start-sleep -milliseconds 5
write-host -nonewline $($Row.D); start-sleep -milliseconds 5
write-host -nonewline $($Row.E); start-sleep -milliseconds 5
write-host -nonewline $($Row.F); start-sleep -milliseconds 5
write-host -nonewline $($Row.G); start-sleep -milliseconds 5
write-host -nonewline $($Row.H); start-sleep -milliseconds 5
write-host -nonewline $($Row.I); start-sleep -milliseconds 5
write-host -nonewline $($Row.J); start-sleep -milliseconds 5
write-host -nonewline $($Row.K); start-sleep -milliseconds 5
write-host -nonewline $($Row.L); start-sleep -milliseconds 5
write-host -nonewline $($Row.M); start-sleep -milliseconds 5
write-host -nonewline $($Row.N); start-sleep -milliseconds 5
write-host -nonewline $($Row.O); start-sleep -milliseconds 5
write-host -nonewline $($Row.P); start-sleep -milliseconds 5
write-host -nonewline $($Row.Q); start-sleep -milliseconds 5
write-host -nonewline $($Row.R); start-sleep -milliseconds 5
write-host -nonewline $($Row.S); start-sleep -milliseconds 5
write-host -nonewline $($Row.T); start-sleep -milliseconds 5
write-host -nonewline $($Row.U); start-sleep -milliseconds 5
write-host -nonewline $($Row.V); start-sleep -milliseconds 5
write-host -nonewline $($Row.W); start-sleep -milliseconds 5
write-host -nonewline $($Row.X); start-sleep -milliseconds 5
write-host -nonewline $($Row.Y); start-sleep -milliseconds 5
write-host -nonewline $($Row.Z); start-sleep -milliseconds 5
2020-12-15 15:21:50 +01:00
}
2020-12-29 15:14:21 +01:00
write-host ""
start-sleep -milliseconds 200
2020-12-15 15:21:50 +01:00
}
exit 0
} catch {
2020-12-25 11:30:43 +01:00
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
2020-12-15 15:21:50 +01:00
exit 1
}