I found this bit of code which removes the last character of a string:
$string -replace ‘.$’
However the about_comparison_operators clearly states that replace takes two parameters. There is obviously an undocumented feature where the second parameter defaults to “”?
If so, why wasnt it included in the official MS doco? Or is it documented somewhere else?