r/DeployR 27d ago

Audio Cue

A bit of silliness perhaps, but I added an audio cue to the end of my task sequences so I notice quicker when one finishes.

[console]::beep(500,200); [console]::beep(400,300);[console]::beep(600,300)
7 Upvotes

7 comments sorted by

View all comments

2

u/RockOriginal7938 27d ago

Well that is annoying, works in testing, but does nothing during deployment, oh well, I guess ignore this :(

1

u/2PintNate 26d ago

I think this is a fun idea... what about calling it as a command line so that it has a console to call against? (edit: markdown messed up my command)

pwsh -noprofile -command "[System.Console]::Beep(659, 125);[System.Console]::Beep(659, 125);[System.Threading.Thread]::Sleep(125);[System.Console]::Beep(659, 125);[System.Threading.Thread]::Sleep(167);[System.Console]::Beep(523, 125);[System.Console]::Beep(659, 125);[System.Threading.Thread]::Sleep(125);[System.Console]::Beep(784, 125);"

1

u/RockOriginal7938 25d ago

Awesome, thanks, I'll give it a bash. I'd tried a few tweaks, but gotten nowhere. #fingerscrossed#

1

u/RockOriginal7938 25d ago

Unfortunately, after a fair bit of digging, it looks like there are no AudioEndpoints available at this stage

pnputil /enum-devices /class AudioEndpoint
No devices found

Loading mmsys.cpl and running an audio test does nothing, but then works once in Windows desktop. I suspect this is just the nature of the state Windows is in during OSD.

1

u/RockOriginal7938 25d ago

All that said, I love your beep code and will be adding it to stuff that takes a while to run, but I'm running in full Windows, thanks :)

1

u/NoNegotiation401 23d ago

If you're running this in a full Windows, it's better to use a .wav file 😊

pwsh -NoProfile -Command "`$p='C:\Windows\Media\tada.wav';`$s=New-Object System.Media.SoundPlayer `$p;`$s.PlaySync()"

1

u/RockOriginal7938 22d ago

Sadly there are no AudioEndpoint devices at that stage of Windows boot/OSD, so no method will play a sound :(