On Stack Overflow a comment to Can PowerShell Core handle ps1 files with CRLF line endings in Linux environments? asserted that executable files that use a shebang must use only the LF line ending, based on a quote from an O'Reilly book. And anecdotal evidence here at shebang line not working with cr-lf seems to bear that out.
But is that an official *nix requirement, or only the behavior on one platform? Is it documented somewhere? And surely isn't there a way around it (e.g. by adding an extra #
before the line ending)?
The implication of this is that PowerShell scripts would be restricted to LF line endings if they were intended to be used cross-platform (as is now possible with the latest PowerShell). See Would it be best for PowerShell scripts to also have a shebang? here, as well as How can I use a shebang in a PowerShell script? on Stack Overflow.