Can you give an example how to return error code 1 on error using PowerShell?
For example handling this situation:
if ($serviceUserName) {
cmd /c $serviceBinaryFinalPath install -username:$serviceUserName -password:$serviceUserPassword -servicename:"$ServiceName" -displayname:"$serviceDisplayName" -description:"$serviceDescription"
} else {
cmd /c $serviceBinaryFinalPath install --localsystem -servicename:"$ServiceName" -displayname:"$serviceDisplayName" -description:"$serviceDescription"
}
try {bla-bla-bla} catch {exit 1}cmd /c? You don't need it.