Skip to content

tell-new-year

Tells the time until New Year

#Requires -Version 5.1

try {
	$now = [DateTime]::Now
	$NewYear = [Datetime]("12/31/" + $now.Year)
	$days = ($NewYear – $now).Days + 1
	if ($days -gt 1) {
		& "$PSScriptRoot/speak-english.ps1" "New Year is in $days days."
	} elseif ($days -eq 1) {
		& "$PSScriptRoot/speak-english.ps1" "New Year is tomorrow."
	}
	exit 0
} catch {
throw
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.