In an attempt to improve my PowerShell and VB.NET coding and scripting skills I decided to build a sort of control interface that would control the sound of a system, shut down a system, turn off the network adapters and the like. And for the weirdest reason I'm having trouble with the sound.
I've been attempting a few things, mostly using the SendKeys
method.
Specifically, the code is:
Invoke-Command -ComputerName computerName -Credential $creds -ScriptBlock {
$ob = New-Object -ComObject wscript.shell | {1..50 | % { $ob.SendKeys([char]174)}}
}
I also tried:
Invoke-Command -ComputerName computerName -Credential $creds -ScriptBlock {
$ob = New-Object -ComObject wscript.shell | $ob.SendKeys([char]173)
}
I found these after searching through Google for some time, and unfortunately I can only get these commands to work on my local Windows 8 base machine, while the remote computer I am testing with is Windows 7. I realize that the difference in operating systems will change the encoding for the sent keys required but I can't find anything different than this and was hoping someone much smarter than me could help.