diff --git a/lib/ansible/modules/windows/win_msi.ps1 b/lib/ansible/modules/windows/win_msi.ps1 index 07126583d1..abb778036c 100644 --- a/lib/ansible/modules/windows/win_msi.ps1 +++ b/lib/ansible/modules/windows/win_msi.ps1 @@ -37,6 +37,10 @@ if (($creates -ne $null) -and ($state -ne "absent") -and (Test-Path $creates)) { Exit-Json $result } +if (-not (Test-Path $path)) { + Fail-Json $result "Cannot find $path." +} + $logfile = [IO.Path]::GetTempFileName() if ($state -eq "absent") {