From eeabebdd6c4115758d502296ffaa7349ce88748e Mon Sep 17 00:00:00 2001 From: Dreamcat4 Date: Wed, 20 Apr 2016 20:26:44 +0100 Subject: [PATCH] fix: win_get_url - fixes for strict-mode --- lib/ansible/modules/windows/win_get_url.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/windows/win_get_url.ps1 b/lib/ansible/modules/windows/win_get_url.ps1 index 75bef615ab..1f0e6580dd 100644 --- a/lib/ansible/modules/windows/win_get_url.ps1 +++ b/lib/ansible/modules/windows/win_get_url.ps1 @@ -105,7 +105,7 @@ Else { Fail-Json $result "Error when requesting Last-Modified date from $url $($_.Exception.Message)" } - If ((Get-Date -Date $webLastMod ) -lt $fileLastMod) { + If (($webLastMod) -and ((Get-Date -Date $webLastMod ) -lt $fileLastMod)) { $result.changed = $false } Else { Download-File -result $result -url $url -dest $dest -username $username -password $password -proxy_url $proxy_url -proxy_username $proxy_username -proxy_password $proxy_password