I've got an odd issue I'm running into and hoping someone here can help. I'm querying against a Scheduled Task on a Windows computer and getting the days when it is slated to execute. However, where I want to see something like "Sunday, Monday, Wednesday, Friday", I get "43".
$taskObject = Get-ScheduledTask -TaskName "MyTestTask" -TaskPath "\Testing\" | Select-Object *
foreach ($trigger in $taskObject.Triggers) {
write-host $trigger.DaysOfWeek
}
I poked at things a bit, but I'm coming up empty on how to easily convert "43" to the list of the selected days. Is there a function or something somewhere that I'm overlooking? How can I convert the listed number to [DayOfWeek[]]$currentDays
?
Thanks!