Exit-Script -ExitCode but in v4?

This is not recognized in 4.1.7 "Exit-Script -ExitCode " but works in 3.9.3.
using Close-ADTSession -ExitCode still continues with Post-Install resulting to install completed even though the pre install condition is False.
Has it been changed or removed completely?
exit also didn't work

Sample working in 3.9.3:
If ($foundPrereq) { installation of app starts } Else { show message -MessageAlignment 'Left' -ButtonRightText 'OK' -Icon Warning -NoWait | Exit-Script -ExitCode '-2016344205' }

I think you can't pipe 2 commands like that.

Maybe stop making everything a oneliner and try this?

If ($foundPrereq) { 
   #installation of app starts 
} Else { 
   Show-ADTInstallationPrompt -Message "No prereq found, exiting..." -ButtonRightText 'OK' -Icon Warning -NoWait
   Close-ADTSession -ExitCode  '2016344205'
 }