in addition to my other scripts you can handover the errorresultcounter ore another counter to a cmd that starts the powershell.
exit.cmd
Code: Select all
powershell -command "& { C:\exit\exit.ps1; exit $lastexitcode }"
Echo %Errorlevel%”
exit.ps1
Code: Select all
$resultcounterend = "999" # If you want to handover a number
# $Resultcounterend = $Resultcounter + $error.count # If you using my othe scripts
# $resultcounterend = $resultcounter # If you want to handover the nomal poweshell error level
Exit $resultcounterend