Merge branch 'master' of github.com:fleschutz/PowerShell

This commit is contained in:
Markus Fleschutz 2022-03-28 11:25:14 +02:00
commit 7a11e4705a
5 changed files with 13 additions and 14 deletions

View File

@ -5,7 +5,6 @@
This PowerShell script plays a short beep sound. This PowerShell script plays a short beep sound.
.EXAMPLE .EXAMPLE
PS> ./play-beep-sound PS> ./play-beep-sound
(listen and enjoy)
.NOTES .NOTES
Author: Markus Fleschutz / License: CC0 Author: Markus Fleschutz / License: CC0
.LINK .LINK

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Turns the audio volume down (-10% by default) Turns the volume down
.DESCRIPTION .DESCRIPTION
This PowerShell script turns the audio volume down (by -10% by default). This PowerShell script turns the audio volume down (-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]174) # each tick is -2% $obj.SendKeys([char]174) # each tick is -2%
} }
& "$PSScriptRoot/give-reply.ps1" "$($percent)% less volume" & "$PSScriptRoot/give-reply.ps1" "$($percent)% softer."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"

View File

@ -1,6 +1,6 @@
<# <#
.SYNOPSIS .SYNOPSIS
Turns the volume off Turn audio off
.DESCRIPTION .DESCRIPTION
This PowerShell script mutes the default audio device immediately. This PowerShell script mutes the default audio device immediately.
.EXAMPLE .EXAMPLE
@ -8,7 +8,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
#> #>
try { try {

View File

@ -1,14 +1,14 @@
<# <#
.SYNOPSIS .SYNOPSIS
Turns the volume on Turn audio on
.DESCRIPTION .DESCRIPTION
This PowerShell script unmutes the audio output. This PowerShell script immediately unmutes the audio output.
.EXAMPLE .EXAMPLE
PS> .\turn-volume-on PS> .\turn-volume-on
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
Author: Markus Fleschutz / License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
try { try {

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))"