Update turn-volume-up.ps1

This commit is contained in:
Markus Fleschutz 2022-03-25 10:09:07 +01:00 committed by GitHub
parent b2a16c4e5c
commit 12639db861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Turns the audio volume up Turns the volume up
.DESCRIPTION .DESCRIPTION
This PowerShell script turns the audio volume up (by +10% by default) This PowerShell script turns the audio volume up (+10% by default).
.PARAMETER percent .PARAMETER percent
Specifies the percent number Specifies the percent number
.EXAMPLE .EXAMPLE
@ -10,7 +10,7 @@
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
Author: Markus Fleschutz / License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
param([int]$percent = 10) param([int]$percent = 10)
@ -20,7 +20,7 @@ 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%
} }
& "$PSScriptRoot/give-reply.ps1" "OK, $($percent)% louder." & "$PSScriptRoot/give-reply.ps1" "$($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))"