Private/Convert-MoonPhase.ps1
function Convert-MoonPhase # FIXME: Does not appear to work; why not? { param ( [Parameter(Mandatory, Position = 0)] [decimal]$MoonPhase ) switch ($MoonPhase) { ($_ -eq 0 -or $_ -eq 1) { return [MoonPhase]::NewMoon } ($_ -eq 0.25) { return [MoonPhase]::FirstQuarterMoon } ($_ -eq 0.5) { return [MoonPhase]::FullMoon } ($_ -eq 0.75) { return [MoonPhase]::LastQuarterMoon } ($_ -lt 0.25) { return [MoonPhase]::WaxingCrescent } ($_ -lt 0.5) { return [MoonPhase]::WaxingGibous } ($_ -lt 0.75) { return [MoonPhase]::WaningGibous } ($_ -lt 1) { return [MoonPhase]::WaningCrescent } } } |