TrimEnd() technically takes an array of single characters, not a string. See https://msdn.microsoft.com/en-us/library/system.string.trimend(v=vs.110).aspx. PowerShell is likely turning “.jrnl” into an array, which means it will remove ., j, r, n, and l from the end. TrimEnd() is a bit more powerful than you might realize.
But for what you’re doing, it’d be much easier just to do a…
Thanks for the reply. I will use the replace function. I find it interesting that TrimEnd is consuming only specific extra characters. I have noticed the behavior with ‘n’ and ‘r’ so maybe it is treating them as ascii codes.