Updated what-is.ps1

This commit is contained in:
Markus Fleschutz
2024-11-02 14:37:14 +01:00
parent 312686d50f
commit f0165acd8d
2 changed files with 5 additions and 3 deletions

View File

@ -17,9 +17,9 @@
param([string]$term = "")
try {
if ($term -eq "" ) { $term = Read-Host "Enter the term/abbreviation/etc. to query" }
if ($term -eq "" ) { $term = Read-Host "Enter the term to query" }
$files = (Get-ChildItem "$PSScriptRoot/../data/dicts/*.csv")
$files = Get-ChildItem "$PSScriptRoot/../data/dicts/*.csv"
$basename = ""
foreach($file in $files) {
$table = Import-CSV "$file"
@ -30,7 +30,8 @@ try {
}
}
if ($basename -eq "") {
& "$PSScriptRoot/open-URL.ps1" "https://www.google.com/search?q=what+is+$term" "🤷‍ Sorry, no '$term' entry found. Let's google it at: "
Write-Host "🤷‍ Sorry, '$term' is unknown to me. Ctrl + click here to google it: " -noNewline
Write-Host "https://www.google.com/search?q=what+is+$term" -foregroundColor blue
}
exit 0 # success
} catch {