1
0
mirror of https://github.com/fleschutz/PowerShell.git synced 2025-07-06 15:40:04 +02:00

Update write-quote.ps1

This commit is contained in:
Markus Fleschutz
2021-10-18 07:26:08 +02:00
committed by GitHub
parent 7f298f5722
commit 7cbd688374

@ -13,10 +13,9 @@
try { try {
$Table = import-csv "$PSScriptRoot/../Data/quotes.csv" $Table = import-csv "$PSScriptRoot/../Data/quotes.csv"
$NumRows = $Table.count
$Generator = New-Object System.Random $Generator = New-Object System.Random
$Index = [int]$Generator.next(0,$NumRows - 1) $Index = [int]$Generator.next(0, $Table.Count - 1)
$Quote = $Table[$Index].Quote $Quote = $Table[$Index].Quote
$Author = $Table[$Index].Author $Author = $Table[$Index].Author