Added more play* scripts

This commit is contained in:
Markus Fleschutz 2021-02-16 19:43:46 +01:00
parent ba6dedd798
commit 0c51ca75e3
8 changed files with 127 additions and 11 deletions

View File

@ -67,6 +67,9 @@ open-browser.ps1, starts the default Web browser
open-calculator.ps1, starts the calculator program
open-email-client.ps1, starts the default email client
play-beep.ps1, plays a beep sound
play-mission-impossible.ps1, plays the Mission Impossible theme
play-super-mario.ps1, plays the Super Mario Intro
play-the-imperial-march.ps1, plays the Imperial March (Star Wars)
poweroff.ps1, halts the local computer (requires admin rights)
query-smart-data.ps1, queries the S.M.A.R.T. data of your HDD/SSD's and saves it to the current/given directory
new-email.ps1, starts the default email client to write a new email

1 Script Description
67 open-calculator.ps1 starts the calculator program
68 open-email-client.ps1 starts the default email client
69 play-beep.ps1 plays a beep sound
70 play-mission-impossible.ps1 plays the Mission Impossible theme
71 play-super-mario.ps1 plays the Super Mario Intro
72 play-the-imperial-march.ps1 plays the Imperial March (Star Wars)
73 poweroff.ps1 halts the local computer (requires admin rights)
74 query-smart-data.ps1 queries the S.M.A.R.T. data of your HDD/SSD's and saves it to the current/given directory
75 new-email.ps1 starts the default email client to write a new email

View File

@ -1,7 +1,7 @@
Collection of PowerShell Scripts
================================
**This repository contains 120+ useful and cross-platform PowerShell scripts in the [Scripts/ folder](Scripts/) - to be used by command-line interface (CLI), for remote control (RC), by context menu, by voice control, by automation software like Jenkins, automatically as daily tasks, or simply to learn PowerShell. See the [FAQ page](Misc/FAQ.md) if you need help or have any questions.**
**This repository contains 130+ useful and cross-platform PowerShell scripts in the [Scripts/ folder](Scripts/) - to be used by command-line interface (CLI), for remote control (RC), by context menu, by voice control, by automation software like Jenkins, automatically as daily tasks, or simply to learn PowerShell. See the [FAQ page](Misc/FAQ.md) if you need help or have any questions.**
Table of Contents
-----------------
@ -72,6 +72,9 @@ Table of Contents
* [open-calculator.ps1](Scripts/open-calculator.ps1) - starts the calculator program
* [open-email-client.ps1](Scripts/open-browser.ps1) - starts the default email client
* [play-beep.ps1](Scripts/play-beep.ps1) - plays a beep sound
* [play-mission-impossible.ps1](Scripts/play-impossible.ps1) - plays the Mission Impossible theme
* [play-super-mario.ps1](Scripts/play-super-mario.ps1) - plays the Super Mario Intro
* [play-the-imperial-march.ps1](Scripts/play-the-imperial-march.ps1) - plays the Imperial March (Star Wars)
* [poweroff.ps1](Scripts/poweroff.ps1) - halts the local computer (requires admin rights)
* [query-smart-data.ps1](Scripts/query-smart-data.ps1) - queries the S.M.A.R.T. data of your HDD/SSD's
* [new-email.ps1](Scripts/new-email.ps1) - starts the default email client to write a new email

View File

@ -12,9 +12,9 @@ try {
if ($DirTree -eq "" ) {
$DirTree = read-host "Enter the path to the directory tree"
}
write-progress "Listing empty files in $DirTree ..."
[int]$Count = 0
Get-ChildItem $DirTree -recurse | Where {$_.PSIsContainer -eq $false} | Where {$_.Length -eq 0} | ForEach-Object {
write-progress "Listing empty files in $DirTree ..."
get-childItem $DirTree -recurse | where {$_.PSIsContainer -eq $false} | where {$_.Length -eq 0} | foreach-object {
write-output $_.FullName
$Count++
}

View File

@ -6,10 +6,5 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
[console]::beep(500,300)
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
[console]::beep(500,300)
exit 0

View File

@ -0,0 +1,55 @@
#!/bin/powershell
<#
.SYNTAX ./play-mission-impossible.ps1
.DESCRIPTION plays the Mission Impossible theme
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(932,150)
Start-Sleep -m 150
[console]::beep(1047,150)
Start-Sleep -m 150
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(699,150)
Start-Sleep -m 150
[console]::beep(740,150)
Start-Sleep -m 150
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(932,150)
Start-Sleep -m 150
[console]::beep(1047,150)
Start-Sleep -m 150
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(784,150)
Start-Sleep -m 300
[console]::beep(699,150)
Start-Sleep -m 150
[console]::beep(740,150)
Start-Sleep -m 150
[console]::beep(932,150)
[console]::beep(784,150)
[console]::beep(587,1200)
Start-Sleep -m 75
[console]::beep(932,150)
[console]::beep(784,150)
[console]::beep(554,1200)
Start-Sleep -m 75
[console]::beep(932,150)
[console]::beep(784,150)
[console]::beep(523,1200)
Start-Sleep -m 150
[console]::beep(466,150)
[console]::beep(523,150)
exit 0

33
Scripts/play-super-mario.ps1 Executable file
View File

@ -0,0 +1,33 @@
#!/bin/powershell
<#
.SYNTAX ./play-super-mario.ps1
.DESCRIPTION plays the Super Mario Intro
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
[console]::beep(659,250) ##E
[console]::beep(659,250) ##E
[console]::beep(659,300) ##E
[console]::beep(523,250) ##C
[console]::beep(659,250) ##E
[console]::beep(784,300) ##G
[console]::beep(392,300) ##g
[console]::beep(523,275) ## C
[console]::beep(392,275) ##g
[console]::beep(330,275) ##e
[console]::beep(440,250) ##a
[console]::beep(494,250) ##b
[console]::beep(466,275) ##a#
[console]::beep(440,275) ##a
[console]::beep(392,275) ##g
[console]::beep(659,250) ##E
[console]::beep(784,250) ## G
[console]::beep(880,275) ## A
[console]::beep(698,275) ## F
[console]::beep(784,225) ## G
[console]::beep(659,250) ## E
[console]::beep(523,250) ## C
[console]::beep(587,225) ## D
[console]::beep(494,225) ## B
exit 0

View File

@ -0,0 +1,27 @@
#!/bin/powershell
<#
.SYNTAX ./play-the-imperial-march.ps1
.DESCRIPTION plays the Imperial March (Star Wars)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
[console]::beep(440,500)
[console]::beep(440,500)
[console]::beep(440,500)
[console]::beep(349,350)
[console]::beep(523,150)
[console]::beep(440,500)
[console]::beep(349,350)
[console]::beep(523,150)
[console]::beep(440,1000)
[console]::beep(659,500)
[console]::beep(659,500)
[console]::beep(659,500)
[console]::beep(698,350)
[console]::beep(523,150)
[console]::beep(415,500)
[console]::beep(349,350)
[console]::beep(523,150)
[console]::beep(440,1000)
exit 0

View File

@ -24,7 +24,7 @@ try {
exit 0
}
}
write-error "Sorry, no German text-to-speech (TTS) voice found"
write-error "No German text-to-speech (TTS) voice found"
exit 1
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"