Advertisement
hodgesb

Unmute & Set Volume 100%

Apr 28th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Shared by Bob Hodges
  2. # Most of the script is from http://stackoverflow.com/questions/21355891/change-audio-level-from-powershell
  3.  
  4. Function Set-Speaker($Volume){
  5. $wshShell = new-object -com wscript.shell;1..50 | % {$wshShell.SendKeys([char]174)};1..$Volume | % {$wshShell.SendKeys([char]175)}
  6. }
  7.  
  8. try {Set-Speaker -Volume 50} #100% Volume
  9. catch {write-output "failed to set volume"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement