I know you can use dayofweek function to get day of week. For instance
(Get-Date).DayOfWeek works
But I am looking to get the day of a specific date so i have
$lastquarter="select convert (char,(SELECT DATEADD(dd, -1, DATEADD(qq, DATEDIFF(qq, 0, GETDATE()), 0))), 23) as lastquarter"
This print out
2022-12-31
When I do
$DayofWeek=$lastquarter_day.DayOfWeek
I get nothing
$DayofWeek=$lastquarter_day.DayOfWeek
I get nothing