Link to home
Start Free TrialLog in
Avatar of G Ram
G Ram

asked on

Get Dayof week in select statement that outputs lastWriteTime -Powershell

Hello,
How do I get the day of week as number or staring as below ?

Get-ChildItem -Path  p  -Filter *.bak | sort LastWriteTime | Where-Object {$_.LastWriteTime -le (Get-Date).AddDays(-0) -and $_.LastWriteTime -ge (Get-Date).AddDays(-7)} |select Name,LastWriteTime,Mode,@{Label="day";Expression=((get-date $_.LastWriteTime).DayOfWeek)}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial