Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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