2020-12-15 15:21:50 +01:00
|
|
|
#!/snap/bin/powershell
|
|
|
|
|
|
|
|
# Syntax: ./simulate-matrix.ps1
|
|
|
|
# Description: simulates the Matrix (fun)
|
|
|
|
# Author: Markus Fleschutz
|
|
|
|
# Source: github.com/fleschutz/PowerShell
|
|
|
|
# License: CC0
|
|
|
|
|
|
|
|
try {
|
2020-12-25 11:30:43 +01:00
|
|
|
write-progress "Reading Matrix.csv..."
|
|
|
|
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
|
|
|
|
$Table = import-csv "$PathToRepo/Data/Matrix.csv"
|
2020-12-15 15:21:50 +01:00
|
|
|
|
|
|
|
Clear-Host
|
|
|
|
foreach($Row in $Table) {
|
|
|
|
for ($i = 0; $i -lt 4; $i++) {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
Write-Host ""
|
|
|
|
Start-Sleep -milliseconds 200
|
|
|
|
}
|
|
|
|
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
|
|
|
|
}
|