mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-11 16:39:10 +01:00
Improved turn-volume-down.ps1 and turn-volume-up.ps1
This commit is contained in:
parent
40b7b500af
commit
ed8618dbae
@ -67,8 +67,8 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
|
||||
* [train-dns-cache.ps1](Scripts/train-dns-cache.ps1) - trains the DNS cache with frequently used domain names
|
||||
* [translate-file.ps1](Scripts/translate-file.ps1) - translates the given file from source to target language
|
||||
* [translate-text.ps1](Scripts/translate-text.ps1) - translates the given text into other languages
|
||||
* [turn-volume-up.ps1](Scripts/turn-volume-up.ps1) - turns the volume up
|
||||
* [turn-volume-down.ps1](Scripts/turn-volume-down.ps1) - turns the volume down
|
||||
* [turn-volume-up.ps1](Scripts/turn-volume-up.ps1) - turns the volume up (+10% by default)
|
||||
* [turn-volume-down.ps1](Scripts/turn-volume-down.ps1) - turns the volume down (-10% by default)
|
||||
* [txt2wav.ps1](Scripts/txt2wav.ps1) - converts text into a audio .WAV file
|
||||
* [unmute-audio.ps1](Scripts/unmute-audio.ps1) - unmutes audio
|
||||
* [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast
|
||||
|
@ -1,14 +1,16 @@
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./turn-volume-down.ps1
|
||||
# Description: turns the volume down
|
||||
# Syntax: ./turn-volume-down.ps1 [<percent>]
|
||||
# Description: turns the volume down (-10% by default)
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
|
||||
Param([Int]$Percent = 10)
|
||||
|
||||
try {
|
||||
$obj = new-object -com wscript.shell
|
||||
for ($i = 0; $i -lt 5; $i++) {
|
||||
$obj = New-Object -com wscript.shell
|
||||
for ($i = 0; $i -lt $Percent; $i += 2) {
|
||||
$obj.SendKeys([char]174) # each tick is -2%
|
||||
}
|
||||
write-output "OK"
|
||||
|
@ -1,14 +1,16 @@
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./turn-volume-up.ps1
|
||||
# Description: turns the volume up
|
||||
# Syntax: ./turn-volume-up.ps1 [<percent>]
|
||||
# Description: turns the volume up (+10% by default)
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
|
||||
Param([Int]$Percent = 10)
|
||||
|
||||
try {
|
||||
$obj = new-object -com wscript.shell
|
||||
for ($i = 0; $i -lt 5; $i++) {
|
||||
$obj = New-Object -com wscript.shell
|
||||
for ($i = 0; $i -lt $Percent; $i += 2) {
|
||||
$obj.SendKeys([char]175) # each tick is +2%
|
||||
}
|
||||
write-output "OK"
|
||||
|
Loading…
Reference in New Issue
Block a user