mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 18:19:32 +02:00
Updated play-beep-sound.ps1
This commit is contained in:
parent
3b8b88c6fa
commit
7501f71794
@ -2,15 +2,21 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Plays a short beep sound
|
Plays a short beep sound
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script plays a short beep sound.
|
This PowerShell script plays a short beep sound at 500Hz for 300ms.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./play-beep-sound
|
PS> ./play-beep-sound.ps1
|
||||||
|
(listen and enjoy)
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[System.Console]::Beep(500,300)
|
try {
|
||||||
Start-Sleep -milliseconds 300
|
[System.Console]::Beep(500,300)
|
||||||
exit 0 # success
|
Start-Sleep -milliseconds 300
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user