Improve turn-volume-up.ps1 and turn-volume-down.ps1

This commit is contained in:
Markus 2021-10-19 17:35:54 +02:00
parent badb85ad23
commit 6e1a1897e8
2 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,8 @@ try {
for ([int]$i = 0; $i -lt $percent; $i += 2) {
$obj.SendKeys([char]174) # each tick is -2%
}
"🔉️ volume -$($percent)%"
"🔉️ -$($percent)%"
& "$PSScriptRoot/speak-english.ps1" "OK, $percent percent less volume"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"

View File

@ -20,7 +20,8 @@ try {
for ([int]$i = 0; $i -lt $percent; $i += 2) {
$obj.SendKeys([char]175) # each tick is +2%
}
"🔊️ volume +$($percent)%"
"🔊️ +$($percent)%"
& "$PSScriptRoot/speak-english.ps1" "OK, $percent percent louder"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"