PowerShell Replacement Rules
Even though we think about working with objects in PowerShell and not parsing strings, a string is still an object, and there are situations where we want to process the string. We may want to change the case. Maybe we want to split or join the string. Or perhaps we need to replace parts of the string. PowerShell provides several replacement techniques. While the result is the same, how PowerShell determines the result differs. There are subtle yet critical distinctions between replacement methods that aren’t readily apparent. Let’s take a closer look.
Replace()
The first technique is the [System.String]
Replace()
method. This is a static method on every string object.
Want to read the full issue?