Added mute-audio.ps1 and unmute-audio.ps1

This commit is contained in:
Markus Fleschutz 2020-12-28 11:00:35 +00:00
parent f8e4c0b5ac
commit 40b7b500af
3 changed files with 36 additions and 0 deletions

View File

@ -41,6 +41,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
* [MD5.ps1](Scripts/MD5.ps1) - prints the MD5 checksum of the given file * [MD5.ps1](Scripts/MD5.ps1) - prints the MD5 checksum of the given file
* [make-install.ps1](Scripts/make-install.ps1) - installs built executables and libs to the installation directory * [make-install.ps1](Scripts/make-install.ps1) - installs built executables and libs to the installation directory
* [moon.ps1](Scripts/moon.ps1) - prints the current moon phase * [moon.ps1](Scripts/moon.ps1) - prints the current moon phase
* [mute-audio.ps1](Scripts/mute-audio.ps1) - mutes audio
* [open-browser.ps1](Scripts/open-browser.ps1) - starts the default Web browser * [open-browser.ps1](Scripts/open-browser.ps1) - starts the default Web browser
* [open-email-client.ps1](Scripts/open-browser.ps1) - starts the default email client * [open-email-client.ps1](Scripts/open-browser.ps1) - starts the default email client
* [play-beep.ps1](Scripts/play-beep.ps1) - plays a beep sound * [play-beep.ps1](Scripts/play-beep.ps1) - plays a beep sound
@ -69,6 +70,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
* [turn-volume-up.ps1](Scripts/turn-volume-up.ps1) - turns the volume up * [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-down.ps1](Scripts/turn-volume-down.ps1) - turns the volume down
* [txt2wav.ps1](Scripts/txt2wav.ps1) - converts text into a audio .WAV file * [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 * [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast
* [weather-alert.ps1](Scripts/weather-alert.ps1) - checks the current weather for critical values * [weather-alert.ps1](Scripts/weather-alert.ps1) - checks the current weather for critical values
* [weather-report.ps1](Scripts/weather-report.ps1) - prints the local weather report * [weather-report.ps1](Scripts/weather-report.ps1) - prints the local weather report

17
Scripts/mute-audio.ps1 Executable file
View File

@ -0,0 +1,17 @@
#!/snap/bin/powershell
# Syntax: ./mute-audio.ps1
# Description: mutes the audio
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
try {
$obj = new-object -com wscript.shell
$obj.SendKeys([char]173)
write-output "OK"
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

17
Scripts/unmute-audio.ps1 Executable file
View File

@ -0,0 +1,17 @@
#!/snap/bin/powershell
# Syntax: ./unmute-audio.ps1
# Description: unmutes the audio
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
try {
$obj = new-object -com wscript.shell
$obj.SendKeys([char]173)
write-output "OK"
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}