Created
July 21, 2017 10:28
-
-
Save RichieBzzzt/0200330502ebc8f1a0b90fc0520a5c67 to your computer and use it in GitHub Desktop.
This file contains 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 Get-FrequencyIntervalValue { | |
[CmdletBinding()] | |
param | |
( | |
[string[]] | |
[ValidateNotNullorEmpty()] | |
$Freq | |
) | |
[int]$Value = 0 | |
if (($Freq -contains "Sunday") -eq $True) {$Value = $Value + 1} | |
if (($Freq -contains "Monday") -eq $True) {$Value = $Value + 2} | |
if (($Freq -contains "Tuesday") -eq $True) {$Value = $Value + 4} | |
if (($Freq -contains "Wednesday") -eq $True) {$Value = $Value + 8} | |
if (($Freq -contains "Thursday") -eq $True) {$Value = $Value + 16} | |
if (($Freq -contains "Friday") -eq $True) {$Value = $Value + 32} | |
if (($Freq -contains "Saturday") -eq $True) {$Value = $Value + 64} | |
if (($Freq -contains "WeekEnds") -eq $True) {$Value = $Value + 65} | |
if (($Freq -contains "WeekDays") -eq $True) {$Value = $Value + 62} | |
if (($Freq -contains "EveryDay") -eq $True) {$Value = $Value + 127} | |
Return $Value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment