I’m trying to sort my list but it’s not sorting as expected. Can you please help understand why?
Invoke-Command -ComputerName $computers {
$rscontent = Get-Item C:tempfile1.txt | Sort-Object LastWriteTime -Descending
"File1.txt last updated: $($rscontent.LastWriteTime) on server $(hostname)"
}