Skip to content

Instantly share code, notes, and snippets.

@ByronScottJones
Created May 22, 2023 12:52
Show Gist options
  • Save ByronScottJones/fc67a10ac16b9536ab5f335bf79843e9 to your computer and use it in GitHub Desktop.
Save ByronScottJones/fc67a10ac16b9536ab5f335bf79843e9 to your computer and use it in GitHub Desktop.
#Download a Dictionary as a CSV file, then pick 5 random words to return
$DictionaryURL="https://www.kaggle.com/datasets/dfydata/the-online-plain-text-english-dictionary-opted?resource=download"
$DictionaryZIP="dictionary.zip"
Invoke-WebRequest -Uri $DictionaryURL -OutFile $DictionaryZIP#
Expand-Archive $DictionaryZIP -DestinationPath .
$EnglishDictionary = import-csv -path .\OPTED-Dictionary.csv
1..5 | % { $EnglishDictionary[$(Get-Random $EnglishDictionary.Count)] | Select Word, Definition }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment