mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-21 15:33:15 +01:00
Updated what-is.ps1
This commit is contained in:
parent
312686d50f
commit
f0165acd8d
@ -297,6 +297,7 @@ NINS,National Institutes of Natural Sciences
|
||||
NIRPS,(NNT) Near Infra Red Planet Searcher
|
||||
NOVA,The Netherlands Research School for Astronomy (Nederlandse Onderzoekschool voor Astronomie)
|
||||
NRAO,National Radio Astronomy Observatory
|
||||
NRQZ,(U.S.) National Radio Quiet Zone
|
||||
NSF,National Science Foundation
|
||||
NTT,New Technology Telescope
|
||||
NUVA,Network for UltraViolet Astrophysics
|
||||
|
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user