mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-08 09:34:34 +02:00
Improve turn-volume-up.ps1 and turn-volume-down.ps1
This commit is contained in:
parent
badb85ad23
commit
6e1a1897e8
@ -20,7 +20,8 @@ try {
|
|||||||
for ([int]$i = 0; $i -lt $percent; $i += 2) {
|
for ([int]$i = 0; $i -lt $percent; $i += 2) {
|
||||||
$obj.SendKeys([char]174) # each tick is -2%
|
$obj.SendKeys([char]174) # each tick is -2%
|
||||||
}
|
}
|
||||||
"🔉️ volume -$($percent)%"
|
"🔉️ -$($percent)%"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "OK, $percent percent less volume"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
@ -20,7 +20,8 @@ try {
|
|||||||
for ([int]$i = 0; $i -lt $percent; $i += 2) {
|
for ([int]$i = 0; $i -lt $percent; $i += 2) {
|
||||||
$obj.SendKeys([char]175) # each tick is +2%
|
$obj.SendKeys([char]175) # each tick is +2%
|
||||||
}
|
}
|
||||||
"🔊️ volume +$($percent)%"
|
"🔊️ +$($percent)%"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "OK, $percent percent louder"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
Loading…
Reference in New Issue
Block a user