Update export-to-serenade.ps1

This commit is contained in:
Markus Fleschutz 2021-10-12 22:14:33 +02:00
parent dd53336397
commit f1c204b798

View File

@ -5,8 +5,8 @@
This script exports all PowerShell scripts to Serenade.ai for voice control. This script exports all PowerShell scripts to Serenade.ai for voice control.
.EXAMPLE .EXAMPLE
PS> ./export-to-serenade.ps1 PS> ./export-to-serenade.ps1
Found 264 scripts, starting export to C:\Users\Markus/.serenade/scripts/PowerShell.js... Exporting 264 scripts to C:\Users\Markus/.serenade/scripts/PowerShell.js...
exported 264 PowerShell scripts for Serenade voice control in 22 sec exported 264 PowerShell scripts to Serenade in 22 sec
.NOTES .NOTES
Author: Markus Fleschutz · License: CC0 Author: Markus Fleschutz · License: CC0
.LINK .LINK
@ -21,7 +21,7 @@ try {
$StopWatch = [system.diagnostics.stopwatch]::startNew() $StopWatch = [system.diagnostics.stopwatch]::startNew()
$Scripts = Get-ChildItem "$FilePattern" $Scripts = Get-ChildItem "$FilePattern"
"Found $($Scripts.Count) scripts, exporting to $TargetFile..." "Exporting $($Scripts.Count) scripts to $TargetFile..."
"/* Exported by export-scripts2serenade.ps1 */" | Set-Content "$TargetFile" "/* Exported by export-scripts2serenade.ps1 */" | Set-Content "$TargetFile"
foreach ($Script in $Scripts) { foreach ($Script in $Scripts) {
@ -36,7 +36,7 @@ try {
} }
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ exported $($Scripts.Count) PowerShell scripts for Serenade voice control in $Elapsed sec" "✔️ exported $($Scripts.Count) PowerShell scripts to Serenade in $Elapsed sec"
exit 0 # success exit 0 # success
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"