-replace using regex, so escape the regex characters. This method does it for you.
[regex]::escape("'WORKVPN1*')")
'WORKVPN1\*'\)
.replace() doesn't use regex, but this overload is case sensitive:
$string.replace("'WORKVPN1*')", "whatever")
I'm just backslashing the star and the parens. You don't have to backquote the parens in the replacement text. $$ is the code for a literal $ in -replace.
"'WORKVPN1*')" -Replace "'WORKVPN1\*'\)",
"WORKVPN1*') -and (`$`$_.VPN -notlike 'WORKVPN2*')"
WORKVPN1*') -and ($_.VPN -notlike 'WORKVPN2*')
By the way, I'm not sure where these -replace codes are buried in the docs:
$number Substitutes the last submatch matched by group number.
${name} Substitutes the last submatch matched by a named capture of the form
(?<name>).
$$ Substitutes a single "$" literal.
$& Substitutes a copy of the entire match itself.
$` Substitutes all the text from the argument string before the matching portion.
$' Substitutes all the text of the argument string after the matching portion.
$+ Substitutes the last submatch captured.
$_ Substitutes the entire argument string.
In .replace(), you would still have to backquote the dollar sign, because of the double-quotes.
"'WORKVPN1*')".Replace("'WORKVPN1*')",
"WORKVPN1*') -and (`$_.VPN -notlike 'WORKVPN2*')")
WORKVPN1*') -and ($_.VPN -notlike 'WORKVPN2*')