Updated some play-* scripts

This commit is contained in:
Markus Fleschutz 2024-01-25 13:58:06 +01:00
parent e73e26f9e7
commit 66d6bc3d52
3 changed files with 200 additions and 181 deletions

View File

@ -4,13 +4,15 @@
.DESCRIPTION .DESCRIPTION
This PowerShell script plays the Imperial March used in the Star Wars film series. This PowerShell script plays the Imperial March used in the Star Wars film series.
.EXAMPLE .EXAMPLE
PS> ./play-imperial-march PS> ./play-imperial-march.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
#> #>
try {
[System.Console]::beep(440, 500) [System.Console]::beep(440, 500)
[System.Console]::beep(440, 500) [System.Console]::beep(440, 500)
[System.Console]::beep(440, 500) [System.Console]::beep(440, 500)
@ -30,3 +32,7 @@
[System.Console]::beep(523, 150) [System.Console]::beep(523, 150)
[System.Console]::beep(440, 1000) [System.Console]::beep(440, 1000)
exit 0 # success exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -4,7 +4,8 @@
.DESCRIPTION .DESCRIPTION
This PowerShell script plays the famous Jingle Bells song. This PowerShell script plays the famous Jingle Bells song.
.EXAMPLE .EXAMPLE
PS> ./play-jingle-bells PS> ./play-jingle-bells.ps1
(listen and enjoy)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -46,6 +47,8 @@ $Duration = New-Object -TypeName psobject -Property @{
EIGHTH = 200 EIGHTH = 200
SIXTEENTH = 100 SIXTEENTH = 100
} }
try {
[System.Console]::Beep($Notes.C, $Duration.EIGHTH ) [System.Console]::Beep($Notes.C, $Duration.EIGHTH )
[System.Console]::Beep($Notes.C, $Duration.EIGHTH ) [System.Console]::Beep($Notes.C, $Duration.EIGHTH )
[System.Console]::Beep($Notes.C, $Duration.QUARTER) [System.Console]::Beep($Notes.C, $Duration.QUARTER)
@ -158,3 +161,7 @@ Start-Sleep -m $Duration.EIGHTH
[System.Console]::Beep($Notes.G, $Duration.QUARTER) [System.Console]::Beep($Notes.G, $Duration.QUARTER)
[System.Console]::Beep($Notes.F, $Duration.HALF) [System.Console]::Beep($Notes.F, $Duration.HALF)
exit 0 # success exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -4,13 +4,15 @@
.DESCRIPTION .DESCRIPTION
This PowerShell script plays the Mission Impossible theme. This PowerShell script plays the Mission Impossible theme.
.EXAMPLE .EXAMPLE
PS> ./play-mission-impossible PS> ./play-mission-impossible.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
#> #>
try {
[System.Console]::Beep(784,150) [System.Console]::Beep(784,150)
Start-Sleep -m 300 Start-Sleep -m 300
[System.Console]::Beep(784,150) [System.Console]::Beep(784,150)
@ -58,3 +60,7 @@ Start-Sleep -m 150
[System.Console]::Beep(466,150) [System.Console]::Beep(466,150)
[System.Console]::Beep(523,150) [System.Console]::Beep(523,150)
exit 0 # success exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}