Powershell control speaker volume how?

Joined
May 7, 2020
Messages
3
Reaction score
0
Hi
I try to control my speaker volume with powershell. I found this script:

Function Set-Speaker($Volume){$wshShell = new-object -com wscript.shell;1..50 | % {$wshShell.SendKeys([char]174)};1..$Volume | % {$wshShell.SendKeys([char]175)}}

after

Set-Speaker -Volume 50

my speaker mutes. All -Volume values (10,20,30,40,50) doing the same only mutes my speaker.

Windows 10 Home latest. Any ideas how to make it works? How to change volume level?
THX
 
Joined
Nov 19, 2013
Messages
6,298
Reaction score
1,273
Maybe not the answer you are hoping for, but I left click the speaker icon on my taskbar and adjust it there.
I don't use Power shell much, so I confess your enquiry is a bit of a mystery to me.
 
Joined
May 7, 2020
Messages
3
Reaction score
0
I want to do it with powershell. I found this function that supposedly works and it doesn't work for me. So i hope someone can help me. Icon, taskbar....yes yes i have mouse to;) but i ask about this.
 
Joined
Nov 19, 2013
Messages
6,298
Reaction score
1,273
A quick look at the script, maybe you need to select a value in the 1...50, like “the 50” ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top