What is the difference between variables $a and $b?
$a
$b
$a = (Get-Date).DayOfWeek $b = Get-Date | Select-Object DayOfWeek
Select-Object creates a new psobject and copies the properties you requested to it. You can verify this with GetType():
PS > $a.GetType().fullname System.DayOfWeek PS > $b.GetType().fullname System.Management.Automation.PSCustomObject