Finally I got the best way to split text to an array of lines. It is using $text -split "`r`n"
Improved thanks to Jaycul's comment.
Pure Capsaicin at Spiceworks!
vor 8 Monaten
This blog is about PowerShell Scripting, therefor it's name is just PowerShell. Ok using german orthografie. I have a Python background and my office duties are databases and reporting related.
Don't forget there's a STRING array overload for String.Split() -- not just a character array, so you can split on a string instead of a character array, or a regular expression:
AntwortenLöschen$text.Split([string[]]"`r`n", [StringSplitOptions]::None)
It's actually more efficient unless you need the regular expression capability.