Reputation: 71
Im completly new to Stackoverflow an I will try my best making this right. So I appriciate Tips!
My Problem: I'm starting to use PowerShell a little bit, an I have a lot of empy lines in the log that I want to output, where there shouldnt be any. I'm just trying to get the LastWriteTime and the Name of the newest file. MyCode and Log
What am I doing wrong?
Upvotes: 0
Views: 77
Reputation: 2629
Almost there - you just need to select the specific properties you want when using the select
cmdlet:
gci -rec *.txt | sort LastWriteTime | select -last 1 LastWriteTime,Name
Upvotes: 1