I am using poshWSUS 2.3.1.6 module and have a query like below:
& Get-PSWSUSClient | select @{name="Computer";expression={$($_.FullDomainName)}},@{name="LastUpdated";expression={$($_.LastReportedStatusTime)}} | export-csv -NoTypeInformation -append $FileOutput
My problem is that for some computers there is no reported status time, so LastReportedStatusTime
is equal to 1/1/0001 12:00:00 AM.
I want to the field: LastSyncTime
for those computers. Basically I need something like
expression= if (LastReportedStatusTime > '1/1/0001 12:00:00 AM') then {$($_.LastReportedStatusTime)}} else {$($_.LastSyncTime)}}
but I couldn't find the correct syntax. I appreciate if you may help.