Removed export-to-serenade.ps1

This commit is contained in:
Markus Fleschutz 2022-04-13 07:26:21 +02:00
parent d68df88c4d
commit 62e99556d2
2 changed files with 2 additions and 52 deletions

View File

@ -218,14 +218,13 @@ Mega Collection of PowerShell Scripts
| Script | Description | Help |
| ------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------- |
| [convert-csv2txt.ps1](Scripts/convert-csv2txt.ps1) | Converts a given .CSV file to a text file | [Help](Docs/convert-csv2txt.md) |
| [convert-csv2txt.ps1](Scripts/convert-csv2txt.ps1) | Converts a .CSV file to a text file | [Help](Docs/convert-csv2txt.md) |
| [convert-mysql2csv.ps1](Scripts/convert-mysql2csv.ps1) | Converts a MySQL database table to a .CSV file | [Help](Docs/convert-mysql2csv.md) |
| [convert-ps2bat.ps1](Scripts/convert-ps2bat.ps1) | Converts a PowerShell script to a .BAT file | [Help](Docs/convert-ps2bat.md) |
| [convert-ps2bat.ps1](Scripts/convert-ps2bat.ps1) | Converts a PowerShell script to a Batch script | [Help](Docs/convert-ps2bat.md) |
| [convert-ps2md.ps1](Scripts/convert-ps2md.ps1) | Converts the comment-based help of a PowerShell script to Markdown | [Help](Docs/convert-ps2md.md) |
| [convert-sql2csv.ps1](Scripts/convert-sql2csv.ps1) | Converts a SQL database table to a .CSV file | [Help](Docs/convert-sql2csv.md) |
| [convert-txt2wav.ps1](Scripts/convert-txt2wav.ps1) | Converts text to a .WAV audio file | [Help](Docs/convert-txt2wav.md) |
| [export-to-manuals.ps1](Scripts/export-to-manuals.ps1) | Exports all scripts as manuals | [Help](Docs/export-to-manuals.md) |
| [export-to-serenade.ps1](Scripts/export-to-serenade.ps1)| Exports all scripts to Serenade for voice control | [Help](Docs/export-to-serenade.md) |
📝 Scripts for Git

View File

@ -1,49 +0,0 @@
<#
.SYNOPSIS
Exports scripts to Serenade
.DESCRIPTION
This PowerShell script exports all scripts to Serenade to execute them by voice.
.PARAMETER WakeWord
Specifies the wake word (none by default)
.PARAMETER FilePattern
Specifies the file pattern for the scripts ("$PSScriptRoot/*.ps1" by default)
.PARAMETER Application
Specifies the application to be used
.PARAMETER TargetFile
Specifies the target file ("$HOME\.serenade\scripts\PowerShell.js" by default)
.EXAMPLE
PS> ./export-to-serenade.ps1 Computer
Found 534 PowerShell scripts...
Writing custom JavaScript file: C:\Users\Markus\.serenade\scripts\PowerShell.js...
Exported to Serenade with wake word "Computer" in 3 sec
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz / License: CC0
#>
#requires -version 2
param([string]$WakeWord = "", [string]$FilePattern = "$PSScriptRoot/*.ps1", [string]$Application = "terminal", [string]$TargetFile = "$HOME\.serenade\scripts\PowerShell.js")
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
$Scripts = Get-ChildItem "$FilePattern"
"⏳ Found $($Scripts.Count) PowerShell scripts..."
"⏳ Writing custom JavaScript file: $TargetFile..."
"/* DO NOT EDIT! This file has been generated automatically by export-to-serenade.ps1 */" | Set-Content "$TargetFile"
foreach ($Script in $Scripts) {
$ScriptName = $Script.basename
$Keyword = $ScriptName -replace "-"," "
"serenade.global().command(`"$($WakeWord.toLower()) $Keyword`",async(api)=>{await api.focusApplication(`"$Application`");await api.pressKey(`"return`");await api.typeText(`"$ScriptName.ps1`");await api.pressKey(`"return`");});" | Add-Content "$TargetFile"
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ Exported to Serenade with wake word `"$WakeWord`" in $Elapsed sec"
exit 0 # success
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}