mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 13:36:39 +01:00
Remove obsolete scripts
This commit is contained in:
parent
0bb7dba477
commit
8262d06631
@ -1,17 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Replies to 'bye bye'
|
||||
.DESCRIPTION
|
||||
This script says a reply to 'bye bye' by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./bye-bye
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
$Reply = "Good bye.", "See you.", "Bye bye." | Get-Random
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
@ -1,17 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Replies to 'bye'
|
||||
.DESCRIPTION
|
||||
This script says a reply to 'bye' by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./bye
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
$Reply = "Bye.", "Good bye.", "See you.", "Bye bye." | Get-Random
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
@ -1,36 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the time until Christmas
|
||||
.DESCRIPTION
|
||||
This script checks the time until Christmas and replies by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-christmas
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
try {
|
||||
$Now = [DateTime]::Now
|
||||
$Christmas = [Datetime]("12/25/" + $Now.Year)
|
||||
$Days = ($Christmas - $Now).Days
|
||||
if ($Days -gt 1) {
|
||||
& "$PSScriptRoot/give-reply.ps1" "Christmas is in $Days days."
|
||||
} elseif ($Days -eq 1) {
|
||||
& "$PSScriptRoot/give-reply.ps1" "Christmas is tomorrow."
|
||||
} elseif ($Days -eq 0) {
|
||||
& "$PSScriptRoot/give-reply.ps1" "Christmas is today."
|
||||
} elseif ($Days -eq 1) {
|
||||
& "$PSScriptRoot/give-reply.ps1" "Christmas is tomorrow."
|
||||
} elseif ($Days -eq -1) {
|
||||
& "$PSScriptRoot/give-reply.ps1" "Christmas was yesterday."
|
||||
} else {
|
||||
$Days = -$Days
|
||||
& "$PSScriptRoot/give-reply.ps1" "Christmas was $Days days ago."
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the time of dawn
|
||||
.DESCRIPTION
|
||||
This script queries the time of dawn and answers by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-dawn
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
function TimeSpanToString { param([TimeSpan]$Delta)
|
||||
$Result = ""
|
||||
if ($Delta.Hours -eq 1) { $Result += "1 hour and "
|
||||
} elseif ($Delta.Hours -gt 1) { $Result += "$($Delta.Hours) hours and "
|
||||
}
|
||||
if ($Delta.Minutes -eq 1) { $Result += "1 minute"
|
||||
} else { $Result += "$($Delta.Minutes) minutes"
|
||||
}
|
||||
return $Result
|
||||
}
|
||||
|
||||
try {
|
||||
[system.threading.thread]::currentThread.currentCulture=[system.globalization.cultureInfo]"en-US"
|
||||
$String = (Invoke-WebRequest http://wttr.in/?format="%D" -UserAgent "curl" -useBasicParsing).Content
|
||||
$Hour,$Minute,$Second = $String -split ':'
|
||||
$Dawn = Get-Date -Hour $Hour -Minute $Minute -Second $Second
|
||||
$Now = [DateTime]::Now
|
||||
if ($Now -lt $Dawn) {
|
||||
$TimeSpan = TimeSpanToString($Dawn - $Now)
|
||||
$Reply = "Dawn is in $TimeSpan at $($Dawn.ToShortTimeString())."
|
||||
} else {
|
||||
$TimeSpan = TimeSpanToString($Now - $Dawn)
|
||||
$Reply = "Dawn was $TimeSpan ago at $($Dawn.ToShortTimeString())."
|
||||
}
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the earth (fun)
|
||||
.DESCRIPTION
|
||||
This script checks the earth and replies by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-earth
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "Earth still spins with 1040mph."
|
||||
exit 0 # success
|
@ -1,15 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the balance (fun)
|
||||
.DESCRIPTION
|
||||
This script checks the balance and replies by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-my-balance
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "OK, what's your account number?"
|
||||
exit 0 # success
|
@ -1,43 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the time of sunrise
|
||||
.DESCRIPTION
|
||||
This script queries the time of sunrise and answers by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-sunrise
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
function TimeSpanToString { param([TimeSpan]$Delta)
|
||||
$Result = ""
|
||||
if ($Delta.Hours -eq 1) { $Result += "1 hour and "
|
||||
} elseif ($Delta.Hours -gt 1) { $Result += "$($Delta.Hours) hours and "
|
||||
}
|
||||
if ($Delta.Minutes -eq 1) { $Result += "1 minute"
|
||||
} else { $Result += "$($Delta.Minutes) minutes"
|
||||
}
|
||||
return $Result
|
||||
}
|
||||
|
||||
try {
|
||||
[system.threading.thread]::currentThread.currentCulture=[system.globalization.cultureInfo]"en-US"
|
||||
$String = (Invoke-WebRequest http://wttr.in/?format="%S" -UserAgent "curl" -useBasicParsing).Content
|
||||
$Hour,$Minute,$Second = $String -split ':'
|
||||
$Sunrise = Get-Date -Hour $Hour -Minute $Minute -Second $Second
|
||||
$Now = [DateTime]::Now
|
||||
if ($Now -lt $Sunrise) {
|
||||
$TimeSpan = TimeSpanToString($Sunrise - $Now)
|
||||
$Reply = "Sunrise is in $TimeSpan at $($Sunrise.ToShortTimeString())."
|
||||
} else {
|
||||
$TimeSpan = TimeSpanToString($Now - $Sunrise)
|
||||
$Reply = "Sunrise was $TimeSpan ago at $($Sunrise.ToShortTimeString())."
|
||||
}
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the time of sunset
|
||||
.DESCRIPTION
|
||||
This script queries the time of sunset and answers by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-sunset
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
function TimeSpanToString { param([TimeSpan]$Delta)
|
||||
$Result = ""
|
||||
if ($Delta.Hours -eq 1) { $Result += "1 hour and "
|
||||
} elseif ($Delta.Hours -gt 1) { $Result += "$($Delta.Hours) hours and "
|
||||
}
|
||||
if ($Delta.Minutes -eq 1) { $Result += "1 minute"
|
||||
} else { $Result += "$($Delta.Minutes) minutes"
|
||||
}
|
||||
return $Result
|
||||
}
|
||||
|
||||
try {
|
||||
[system.threading.thread]::currentThread.currentCulture=[system.globalization.cultureInfo]"en-US"
|
||||
$String = (Invoke-WebRequest http://wttr.in/?format="%s" -UserAgent "curl" -useBasicParsing).Content
|
||||
$Hour,$Minute,$Second = $String -split ':'
|
||||
$Sunset = Get-Date -Hour $Hour -Minute $Minute -Second $Second
|
||||
$Now = [DateTime]::Now
|
||||
if ($Now -lt $Sunset) {
|
||||
$TimeSpan = TimeSpanToString($Sunset - $Now)
|
||||
$Reply = "Sunset is in $TimeSpan at $($Sunset.ToShortTimeString())."
|
||||
} else {
|
||||
$TimeSpan = TimeSpanToString($Now - $Sunset)
|
||||
$Reply = "Sunset was $TimeSpan ago at $($Sunset.ToShortTimeString())."
|
||||
}
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks for Tea time
|
||||
.DESCRIPTION
|
||||
This script checks the time until Tea time and replies by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-tea-time
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
function TimeSpanToString { param([TimeSpan]$Delta)
|
||||
$Result = ""
|
||||
if ($Delta.Hours -eq 1) { $Result += "1 hour and "
|
||||
} elseif ($Delta.Hours -gt 1) { $Result += "$($Delta.Hours) hours and "
|
||||
}
|
||||
if ($Delta.Minutes -eq 1) { $Result += "1 minute"
|
||||
} else { $Result += "$($Delta.Minutes) minutes"
|
||||
}
|
||||
return $Result
|
||||
}
|
||||
|
||||
try {
|
||||
$Now = [DateTime]::Now
|
||||
$TeaTime = Get-Date -Hour 16 -Minute 0 -Second 0
|
||||
if ($Now -lt $TeaTime) {
|
||||
$TimeSpan = TimeSpanToString($TeaTime - $Now)
|
||||
$Reply = "Tea time is in $TimeSpan."
|
||||
} else {
|
||||
$TimeSpan = TimeSpanToString($Now - $TeaTime)
|
||||
$Reply = "Tea time was $TimeSpan ago."
|
||||
}
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Determines the current year
|
||||
.DESCRIPTION
|
||||
This script determines and speaks the current year by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-year
|
||||
✔️ It's 2021.
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
try {
|
||||
$Year = (Get-Date).Year
|
||||
& "$PSScriptRoot/give-reply.ps1" "It's $Year."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the time of zenith
|
||||
.DESCRIPTION
|
||||
This script queries the time of zenith and answers by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-zenith
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
try {
|
||||
$Reply = (Invoke-WebRequest http://wttr.in/?format="Zenith is at %z." -UserAgent "curl" -useBasicParsing).Content
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Replies to 'good bye'
|
||||
.DESCRIPTION
|
||||
This script says a reply to 'good bye' by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./good-bye
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
$Reply = "Good bye.", "See you.", "Bye bye." | Get-Random
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
@ -1,17 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Replies to 'good evening'
|
||||
.DESCRIPTION
|
||||
This script says a reply to 'good evening' by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./good-evening
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
$Reply = "And a special good evening to you too."
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
@ -1,17 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Replies to 'good night'
|
||||
.DESCRIPTION
|
||||
This script says a reply to 'good night' by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./good-night
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
$Reply = "Good night to you too.", "Good night to you my friend.", "Have a good night. Sleep well.", "Good night and sweet dreams." | Get-Random
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
Loading…
Reference in New Issue
Block a user