Replaces each substring that matches the literal target sequence with the specified literal replacement sequence.
Note: The replace string method is case sensitive.
$[ScriptVariable]::replace(String target, String replacement)
The following examples illustrate the syntax for the replace string method:
$str1 = "AQA"
$str1::replace("A", "B")
print($str1)
BQB
$str2 = "Hello World"
$str2::replace("Hello", "Goodbye")
print($str2)
Goodbye World