Update the scripts

This commit is contained in:
Markus Fleschutz
2021-12-13 10:52:50 +01:00
parent 50ea7be8f1
commit 7b5165e34d
2 changed files with 19 additions and 7 deletions

View File

@ -14,8 +14,12 @@
try {
$Now = [DateTime]::Now
$NewYear = [Datetime]("12/31/" + $Now.Year)
$Diff = $NewYear $Now
& "$PSScriptRoot/give-reply.ps1" "New Year is in $($Diff.Days) days."
$Days = ($NewYear $Now).Days + 1
if ($Days -gt 1) {
& "$PSScriptRoot/give-reply.ps1" "New Year is in $Days days."
} elseif ($Days -eq 1) {
& "$PSScriptRoot/give-reply.ps1" "New Year is tomorrow."
}
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"