mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 06:08:36 +01:00
Update export-to-serenade.ps1 and list-cli-tools.ps1
This commit is contained in:
parent
304d2fc265
commit
ba17f5b5e4
@ -1,6 +1,6 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Exports all scripts to Serenade
|
||||
Exports scripts to Serenade
|
||||
.DESCRIPTION
|
||||
This script exports all PowerShell scripts to Serenade to execute them by voice.
|
||||
.PARAMETER WakeWord
|
||||
@ -37,7 +37,7 @@ try {
|
||||
foreach ($Script in $Scripts) {
|
||||
$ScriptName = $Script.basename
|
||||
$Keyword = $ScriptName -replace "-"," "
|
||||
"serenade.global().command(`"$($WakeWord.toLower()) $Keyword`", async (api) => { await api.focusOrLaunchApplication(`"$Application`"); await api.typeText(`"$ScriptName.ps1`"); await api.pressKey(`"return`"); });" | Add-Content "$TargetFile"
|
||||
"serenade.global().command(`"$($WakeWord.toLower()) $Keyword`",async(api)=>{await api.focusOrLaunchApplication(`"$Application`");await api.typeText(`"$ScriptName.ps1`");await api.pressKey(`"return`");});" | Add-Content "$TargetFile"
|
||||
}
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
|
@ -107,6 +107,7 @@ function ListTools {
|
||||
CheckFor perl "--version"
|
||||
CheckFor ping "-V"
|
||||
CheckFor ping6 "-V"
|
||||
CheckFor powershell "--version"
|
||||
CheckFor print ""
|
||||
CheckFor printf "--version"
|
||||
CheckFor python "--version"
|
||||
@ -169,7 +170,7 @@ function ListTools {
|
||||
}
|
||||
|
||||
try {
|
||||
ListTools | format-table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Location';width=45},@{e='FileSize';width=10}
|
||||
ListTools | format-table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Location';width=50},@{e='FileSize';width=10}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
|
Loading…
Reference in New Issue
Block a user