PS2EXE
PS2EXE copied to clipboard
Multiline strings change line returns
If I run the script I get no errors from a program that is expecting LF returns in the data, but when running it after converting through PS2EXE I get a parsing error showing the line return is changed into a carriage return.
TLDR;
It seems that LF gets changes to CRLF in multiline strings.
multiline string defined using
@" multi line "@
I'm going to try to figure out a workaround, but wanted to put the issue in here in case it ever happens to someone else.
Workaround is that you can use `n on a single line string to do new line returns. If you also need double quotes inside the multiline string you can escape them with `"
Hello @justinledwards;
I do not see any issue here. We're on Windows, CRLF is the standard for a new line marker. Only LF is Unix-type.
And what is "the data", and what is "a program"?
Greetings
Markus
Closed since no reaction
This can stay closed, I was just cleaning out my alerts.
I was making metrics for prometheus. It required the new lines to be LF, the powershell script itself processed the newlines, but when converted to an exe it lost the formatting. I eventually rewrote what I was doing in C#. It was quite the edge case that probably wouldn't be encountered again.