Update what-is.ps1

This commit is contained in:
Markus Fleschutz
2021-11-29 07:59:13 +01:00
parent 742865ea2c
commit 75dc90af86
3 changed files with 96 additions and 6 deletions

View File

@ -14,8 +14,8 @@
.EXAMPLE
PS> ./export-to-serenade.ps1 Computer
⏳ Found 499 PowerShell scripts...
⏳ Writing to custom JavaScript file C:\Users\Markus\.serenade\scripts\PowerShell.js...
✔️ export to Serenade with wake word "Computer" finished in 3 sec
⏳ Writing custom JavaScript file C:\Users\Markus\.serenade\scripts\PowerShell.js...
✔️ Exported to Serenade with wake word "Computer" in 3 sec
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
@ -31,7 +31,7 @@ try {
$Scripts = Get-ChildItem "$FilePattern"
"⏳ Found $($Scripts.Count) PowerShell scripts..."
"⏳ Writing to custom JavaScript file $TargetFile..."
"⏳ Writing custom JavaScript file $TargetFile..."
"/* NOTE: This file has been generated automatically by export-to-serenade.ps1 */" | Set-Content "$TargetFile"
foreach ($Script in $Scripts) {
@ -41,7 +41,7 @@ try {
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ export to Serenade with wake word `"$WakeWord`" finished in $Elapsed sec"
"✔️ Exported to Serenade with wake word `"$WakeWord`" in $Elapsed sec"
exit 0 # success
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -31,7 +31,7 @@ try {
foreach($Row in $Table) {
if ($Row.Abbreviation -eq $abbreviation) {
$Basename = (get-item "$File").Basename
Reply " $($Row.Definition) ($($Row.Abbreviation)) in $Basename."
Reply " - $($Row.Definition) ($($Row.Abbreviation)) in $Basename"
$FoundOne = $true
}
}