I tried the solution form here but I get the error (my translation) Regex.Split is unknown??
I need to split the line into an string-array but keeping the begin of the lines
Here you go:
$regex = [regex] '(?=prg=PowerShell°)'
$splitarray = $regex.Split($subject);
To split, we are using a zero-width match (i.e., we split without losing characters). To do this, we look ahead to see if the next characters are prg=PowerShell°
This is what the regex (?=prg=PowerShell°)
does.