Last active
December 13, 2024 18:25
-
-
Save StartAutomating/b4877182d79c4e22514fed8f98a8ebbe to your computer and use it in GitHub Desktop.
Gist gotta calculate Friday the 13th
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f13($n=13) { | |
$day, $f13 = (Get-Date).Date, @() | |
do { | |
if ($day.DayOfWeek * $day.Day -eq 65) { | |
$f13 += $day | |
} | |
$day = $day.AddDays(1) | |
} while ($f13.Count -lt $n) | |
$f13 | |
} | |
f13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment