mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 18:19:32 +02:00
Update write-joke.ps1
This commit is contained in:
parent
d5a0a2a7e5
commit
7f298f5722
@ -14,10 +14,9 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$Table = import-csv "$PSScriptRoot/../Data/jokes.csv"
|
$Table = import-csv "$PSScriptRoot/../Data/jokes.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)
|
||||||
$Joke = $Table[$Index].Joke
|
$Joke = $Table[$Index].Joke
|
||||||
|
|
||||||
"$Joke 😂"
|
"$Joke 😂"
|
||||||
|
Loading…
Reference in New Issue
Block a user