Desmond,
Welcome back to the forum. … long time no see …
Before we proceed …
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Wow. You are allowed to use complete sentences and be as verbose as you probably would be when we’d actually talk with each other face to face.
The code works if the copied text is copied as a raw string including the line breaks - not as an array of lines. For example … if you read the content of a text file with
Get-Content -Path .\SampleText.txt -raw
you can use this code to remove the line breaks and replace them with dashes.