A Unix shell (bash, dash tried) interprets a script line by line. This allows to attach some binary data to the end of the script. My particular example is a Jar file that can be automatically unzipped or run from that very script.
I wonder if this is somehow possible with PowerShell too. I tried and got errors which indicate that the PowerShell seems to parse the whole file first before starting to run it.
Is there a way to mark the rest of a file such that the PowerShell does not try to interpret it but just ignores it?
Since my specific use case is that I want to make a Jar file executable, solutions relying on base64 encoding the binary blob do not work.
To be even more explicit: the script will basically run
java -jar $MyInvocation.MyCommand.Definition @Args
such that java shall use the file as a jar file.