mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-26 14:26:10 +01:00
Update write-joke.ps1
This commit is contained in:
parent
d5a0a2a7e5
commit
7f298f5722
@ -14,10 +14,9 @@
|
||||
|
||||
try {
|
||||
$Table = import-csv "$PSScriptRoot/../Data/jokes.csv"
|
||||
$NumRows = $Table.count
|
||||
|
||||
$Generator = New-Object System.Random
|
||||
$Index = [int]$Generator.next(0,$NumRows - 1)
|
||||
$Index = [int]$Generator.next(0, $Table.Count - 1)
|
||||
$Joke = $Table[$Index].Joke
|
||||
|
||||
"$Joke 😂"
|
||||
|
Loading…
Reference in New Issue
Block a user