diff --git a/wDayzManager.ps1 b/wDayzManager.ps1 index 1e5bdc8..12a5b4d 100644 --- a/wDayzManager.ps1 +++ b/wDayzManager.ps1 @@ -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 } }