diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1 index c73d2ab2c0f823cc554173f7dcd1f0b4ea27bdbc..5c9d56926124ff9ef96e225822d50804346eacba 100644 --- a/Updater/Update-Service.ps1 +++ b/Updater/Update-Service.ps1 @@ -139,6 +139,11 @@ function Get-WriteTime([string]$FileName) { try { $TimeStamp = (Get-Item "$FileName" -EA Stop).LastWriteTime } + catch [System.Management.Automation.ItemNotFoundException] { + Write-Verbose "File [$($FileName)] can't be found!" + throw [System.Management.Automation.ItemNotFoundException] ` + "File not found: $($FileName)." + } catch { $ex = $_.Exception.Message Log-Error "Error determining file age of [$($FileName)]!`n$($ex)"