Added terminating script.

Added terminating script if error occured while copying.
This commit is contained in:
2024-12-20 11:41:34 +03:00
parent 4fbb610d56
commit 143e0bc7aa

View File

@@ -303,11 +303,11 @@ foreach ($srv in $servers) {
# Checks for server's config file is exist and copy it to profile location if not
if (-not (Test-Path -Path "$($serverProfile)\")) {
New-Item -ItemType Directory -Path "$($serverProfile)\" | Out-Null
Copy-Item -Path "$($serverLocation)\serverDZ.cfg" -Destination "$($serverProfile)\$($serverConfig)"
Copy-Item -Path "$($serverLocation)\serverDZ.cfg" -Destination "$($serverProfile)\$($serverConfig)" -ErrorAction Stop
}
else {
if (-not (Test-Path -Path "$($serverProfile)\$($serverConfig)")) {
Copy-Item -Path "$($serverLocation)\serverDZ.cfg" -Destination "$($serverProfile)\$($serverConfig)"
Copy-Item -Path "$($serverLocation)\serverDZ.cfg" -Destination "$($serverProfile)\$($serverConfig)" -ErrorAction Stop
}
}