Skip to content
Snippets Groups Projects
Commit 6d3919ee authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Wrap creation of marker file in try/catch block.

Refers to #13
parent 989ebf42
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment