mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-30 12:41:46 +02:00
Added turn-volume-up.ps1 and turn-volume-down.ps1
This commit is contained in:
19
Scripts/turn-volume-down.ps1
Executable file
19
Scripts/turn-volume-down.ps1
Executable file
@ -0,0 +1,19 @@
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./turn-volume-down.ps1
|
||||
# Description: turns the volume down
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
|
||||
try {
|
||||
$obj = new-object -com wscript.shell
|
||||
for ($i = 0; $i -lt 5; $i++) {
|
||||
$obj.SendKeys([char]174) # each tick is -2%
|
||||
}
|
||||
write-output "OK"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
19
Scripts/turn-volume-up.ps1
Executable file
19
Scripts/turn-volume-up.ps1
Executable file
@ -0,0 +1,19 @@
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./turn-volume-up.ps1
|
||||
# Description: turns the volume up
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
|
||||
try {
|
||||
$obj = new-object -com wscript.shell
|
||||
for ($i = 0; $i -lt 5; $i++) {
|
||||
$obj.SendKeys([char]175) # each tick is +2%
|
||||
}
|
||||
write-output "OK"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Reference in New Issue
Block a user