Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Cannot deduct one date from another.

$
0
0

This is simple, I know, but for some reason I am unable to do it.

The date gets imported from a csv file and subtracted from the current date to reveal an integer of days difference.

Powershell
$devices=Import-Csv.\Desktop\names.csv-Delimiter";"ForEach($itemin$devices){$name=$($item.name)[datetime]$date=$($item.date)[datetime]$today=Get-Date-format"dd.MM.yyyy"$newDate=[datetime]$today-$date}

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images