This is a really simple but possibly worthwhile thing to know about. Let’s say you have a long running command or script and (like me) you’re juggling about 25 other Windows besides your PowerShell session. You can easily set up an alert mechanism to let you know that your script has complete with this one simple line of code:
write-host `a |
This will cause a (rather loud) beep sound to occur (like computers used to make back before they had sound cards).
Possible places to use this in your code is upon script/command completion or when an error occurs. You could also add this command to execute right after a script as follows:
./myscript; write-host `a |
Add more beeps if you like:
./myscript; write-host `a`a`a |
Note: Be sure to use the single back-quote character (a regular single quote will not work).
This doesn’t work if the system’s PC SPEAKER is not working.
True that!
Good Point Cory.