We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b8b88c commit 7501f71Copy full SHA for 7501f71
scripts/play-beep-sound.ps1
@@ -2,15 +2,21 @@
2
.SYNOPSIS
3
Plays a short beep sound
4
.DESCRIPTION
5
- This PowerShell script plays a short beep sound.
+ This PowerShell script plays a short beep sound at 500Hz for 300ms.
6
.EXAMPLE
7
- PS> ./play-beep-sound
+ PS> ./play-beep-sound.ps1
8
+ (listen and enjoy)
9
.LINK
10
https://github.com/fleschutz/PowerShell
11
.NOTES
12
Author: Markus Fleschutz | License: CC0
13
#>
14
-[System.Console]::Beep(500,300)
15
-Start-Sleep -milliseconds 300
16
-exit 0 # success
+try {
+ [System.Console]::Beep(500,300)
17
+ Start-Sleep -milliseconds 300
18
+ exit 0 # success
19
+} catch {
20
+ "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
21
+ exit 1
22
+}
0 commit comments