I have a function accepting an enum value as parameter. As an example, consider something like:
(PS) > function IsItFriday([System.DayOfWeek] $dayOfWeek) {
Even handier is that strings will get converted to enum values if valid:
function IsItFriday([System.DayOfWeek] $dayOfWeek) { if($dayOfWeek -eq [System.DayOfWeek]::Friday) { "yes" } else { "no" } } PS 7> IsItFriday Monday no PS 8> IsItFriday Friday yes