Try switch statement to see if that works
Reference - https://powershellexplained.com/2018-01-12-Powershell-switch-statement/?utm_source=blog&utm_medium=blog&utm_content=ifstatement
$day = 3
switch ( $day )
{
0 { $result = 'Sunday' }
1 { $result = 'Monday' }
2 { $result = 'Tuesday' }
3 { $result = 'Wednesday' }
4 { $result = 'Thursday' }
5 { $result = 'Friday' }
6 { $result = 'Saturday' }
}
$result
# Output
'Wednesday'
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav