Hi guys, do you know how to grab rows that are within the first 14 days starting from the earliest date (which is Sept 13th to Sept 27th, but I want my script to be programmed so from the earliest date to 14 days later will be run no matter what the earliest date is). Because the column Planned Start Date have values that consists of all dates.
$days = (Get-Date).AddDays(-14) Import-CSV -path 'C:\Temp\Excel6.csv' | Where-Object [DateTime]$_.'Planned Start Date' -le $days } | Export-CSV -path 'C:Temp\Excel6.csv -NoTypeInformation
But its output nothing of value and the result is a blank spreadsheet? Any way I can fix this? Thanks!