Zodiac Calculator (aka “Sternzeichen”)

by Jul 17, 2023

Ever wanted to automatically convert dates to zodiacs? Here is a fascinatingly simple script that can do it for you, both in English and German:

param (
[Parameter(Mandatory)]
[DateTime]$Date
)

$cutoff = $Date.toString('"0000-"MM-dd')
'Zodiac,Sternzeichen,StartDate
Capricorn,Steinbock,0000-01-20
Aquarius,Wassermann,0000-01-21
Pisces,Fische,0000-02-20
Aries,Widder,0000-03-21
Taurus,Stier,0000-04-21
Gemini,Zwillinge,0000-05-21
Cancer,Krebs,0000-06-22
Leo,Löwe,0000-07-23
Virgo,Jungfrau,0000-08-23
Libra,Waage,0000-09-23
Scorpio,Skorpion,0000-10-23
Sagittarius,Schütze,0000-11-22' | 
ConvertFrom-Csv |
Where-Object StartDate -lt $cutoff |
Select-Object -Last 1