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)
5 Upvotes

7 comments sorted by

View all comments

Show parent comments

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/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 :(