I want to replace string in $test
that contains $folder
, there's no syntax error but nothing is replaced:
$folder = 'c: est'
$test = 'c: estsubtest' -replace $folder, ""
See Question&Answers more detail:os$test still contains 'c: estsubtest'