I typed this:
$folder = 'c:\test'
"c:\test" -replace $folder ""
but get this error:
At line:1 char:25
+ "c:\test" -replace $folder ""
+ ~~
Unexpected token '""' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
This doesn't help me How to handle backslash character in PowerShell -replace string operations?