From 75ef111a186bb666f5972616466bbc04a49e1b95 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 27 Jun 2024 12:45:47 +0200 Subject: [PATCH] Updated what-is.ps1 --- data/dicts/general.csv | 1 + scripts/what-is.ps1 | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/dicts/general.csv b/data/dicts/general.csv index df1989eb..55c999bb 100644 --- a/data/dicts/general.csv +++ b/data/dicts/general.csv @@ -2789,6 +2789,7 @@ MACHO,MAssive Compact Halo Object MADD,"Mothers Against Drunk Driving,MyoAdenylate Deaminase Deficiency,Multiply-Add" MAF,Maintenance Action Form MAFF,Ministry of Agriculture,Forestry and Fisheries (various countries) +MAGA,Make America Great Again MAGIC,Major Atmospheric Gamma-ray Imaging Cherenkov (telescope) MAGNETAR,Metaprogrammable AGent NETwork ARchitecture MAGTF,Marine Air-Ground Task Force diff --git a/scripts/what-is.ps1 b/scripts/what-is.ps1 index 51508856..c2b22195 100755 --- a/scripts/what-is.ps1 +++ b/scripts/what-is.ps1 @@ -7,7 +7,7 @@ Specifies the term to query .EXAMPLE PS> ./what-is VTOL - 💡 VTOL in aviation refers to Vertical Take-Off and Landing + 💡 VTOL in aviation refers to: Vertical Take-Off and Landing .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -18,6 +18,7 @@ param([string]$term = "") try { if ($term -eq "" ) { $term = Read-Host "Enter the term/abbreviation/etc. to query" } + $files = (Get-ChildItem "$PSScriptRoot/../data/dicts/*.csv") $basename = "" foreach($file in $files) { @@ -28,7 +29,9 @@ try { "💡 $($row.TERM) in $basename refers to: $($row.MEANING)" } } - if ($basename -eq "") { "🤷‍ Sorry, no '$term' entry found. Use to google it: https://www.google.com/search?q=what+is+$term" } + 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: " + } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"