Jak podzielić łańcuch po łańcuchach w Powershell

Próbuję wypluć ciąg za pomocą separatora, który jest łańcuchem:

$string = "5637144576, messag<>est<<>>5637145326, 1<<>>5637145328, 0"
$separator = "<<>>"
$string.Split($separator)

W wyniku podziału otrzymuję:

5637144576, messag

est



5637145326, 1



5637145328, 0

Zamiast

5637144576, messag<>est
5637145326, 1
5637145328, 0

Kiedy próbuję użyć przeciążonego podziału, który akceptuje ciąg []:

$string = "5637144576, messag<>est<<>>5637145326, 1<<>>5637145328, 0"
$separator = @("<<>>")
$string.Split($separator)

Ale dostaję następny błąd:

Cannot convert argument "0", with value: "System.Object[]", for "Split" to type "System.Char[]": "Cannot convert value "<<>>" to type "System.Char". Error: "String must be exactly one character long.""

Czy ktoś wie, jak podzielić łańcuch na sznurki?

questionAnswers(4)

yourAnswerToTheQuestion