Added terminating script.
Added terminating script if error occured while copying.
This commit is contained in:
@@ -303,11 +303,11 @@ foreach ($srv in $servers) {
|
|||||||
# Checks for server's config file is exist and copy it to profile location if not
|
# Checks for server's config file is exist and copy it to profile location if not
|
||||||
if (-not (Test-Path -Path "$($serverProfile)\")) {
|
if (-not (Test-Path -Path "$($serverProfile)\")) {
|
||||||
New-Item -ItemType Directory -Path "$($serverProfile)\" | Out-Null
|
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 {
|
else {
|
||||||
if (-not (Test-Path -Path "$($serverProfile)\$($serverConfig)")) {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user