PowerShell/scripts/play-happy-birthday.ps1

46 lines
1.4 KiB
PowerShell
Raw Normal View History

2024-10-01 15:24:16 +02:00
<#
2021-08-16 17:15:31 +02:00
.SYNOPSIS
2022-12-29 21:46:35 +01:00
Plays the Happy Birthday song
2021-10-04 21:29:23 +02:00
.DESCRIPTION
2022-12-29 21:46:35 +01:00
This PowerShell script plays the famous Happy Birthday song.
2021-08-16 17:15:31 +02:00
.EXAMPLE
2024-01-25 13:52:52 +01:00
PS> ./play-happy-birthday.ps1
(listen and enjoy)
2021-08-16 17:15:31 +02:00
.LINK
2022-12-29 21:46:35 +01:00
https://github.com/fleschutz/PowerShell
2022-06-01 09:32:11 +02:00
.NOTES
Author: Markus Fleschutz | License: CC0
2021-08-16 17:15:31 +02:00
#>
2024-01-25 13:52:52 +01:00
try {
[System.Console]::Beep(1059.274, 300)
[System.Console]::Beep(1059.274, 200)
[System.Console]::Beep(1188.995, 500)
[System.Console]::Beep(1059.274, 500)
[System.Console]::Beep(1413.961, 500)
[System.Console]::Beep(1334.601, 950)
[System.Console]::Beep(1059.274, 300)
[System.Console]::Beep(1059.274, 200)
[System.Console]::Beep(1188.995, 500)
[System.Console]::Beep(1059.274, 500)
[System.Console]::Beep(1587.117, 500)
[System.Console]::Beep(1413.961, 950)
[System.Console]::Beep(1059.274, 300)
[System.Console]::Beep(1059.274, 200)
[System.Console]::Beep(2118.547, 500)
[System.Console]::Beep(1781.479, 500)
[System.Console]::Beep(1413.961, 500)
[System.Console]::Beep(1334.601, 500)
[System.Console]::Beep(1188.995, 500)
[System.Console]::Beep(1887.411, 300)
[System.Console]::Beep(1887.411, 200)
[System.Console]::Beep(1781.479, 500)
[System.Console]::Beep(1413.961, 500)
[System.Console]::Beep(1587.117, 500)
[System.Console]::Beep(1413.961, 900)
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}