error action added

This commit is contained in:
mahim23 2018-09-12 14:31:32 +05:30
parent d0688779fb
commit e026969331
1 changed files with 5 additions and 1 deletions

View File

@ -60,10 +60,14 @@ function Start-Embark {
$run_opts = $run_opts + "--rm" $run_opts = $run_opts + "--rm"
} }
$OldErrorActionPreference = $ErrorActionPreference
$ErrorActionPreference = 'Continue'
function Cleanup { function Cleanup {
$retval = $lastexitcode $retval = $lastexitcode
Remove-Item -Path Function:\Confirm-Docker Remove-Item -Path Function:\Confirm-Docker
Remove-Item -Path Function:\Cleanup Remove-Item -Path Function:\Cleanup
$ErrorActionPreference = $OldErrorActionPreference
return $retval return $retval
} }
@ -143,7 +147,7 @@ RUN"
$opts = $run_opts + "${EMBARK_DOCKER_IMAGE}:${EMBARK_DOCKER_TAG}" + $cmd $opts = $run_opts + "${EMBARK_DOCKER_IMAGE}:${EMBARK_DOCKER_TAG}" + $cmd
"docker run $opts" docker run $opts
return Cleanup return Cleanup
} }