Today (2017-05-29) I am using PowerShell 5.0.10586.117 on Windows 7 Enterprise and run the following (shortened):
$dateOfLicense = \"2017-04-20\" $dateOfToda
You are assigning 14 to $TimeDifference. Instead you wan't to compare the Days property using -le:
14
$TimeDifference
Days
-le
if ($TimeDifference.Days -le 14) { Write-Host "test" }