diff --git a/AutoTx-Updater/Update-Service.ps1 b/AutoTx-Updater/Update-Service.ps1 index 0b0f5b6a88ee5f234a919d42e9e43e00d484e82f..07b4bc84a038a1f9a00d544fbd7aa5499c4bd56b 100644 --- a/AutoTx-Updater/Update-Service.ps1 +++ b/AutoTx-Updater/Update-Service.ps1 @@ -232,7 +232,14 @@ function Update-ServiceBinaries { Log-Info "Marker file ($($MarkerFile)) missing, trying to update service." Stop-MyService Copy-ServiceFiles - New-Item -Type File "$MarkerFile" | Out-Null + try { + New-Item -Type File "$MarkerFile" -ErrorAction Stop | Out-Null + Write-Verbose "Created marker file: $($MarkerFile)" + } + catch { + Log-Error "Creating $($MarkerFile) FAILED!`n$($_.Exception.Message)" + Exit + } }