String you want to delete:
$Path = "C:\PowerShell\test.txt" # string that contains brackets $String = "<Value>\[SERVER:8888\],Timeout=10</Value>" (Get-Content $Path) | Foreach-Object {$_ -replace "$String", ""} | Set-Content $Path
Lab Core | The Lab of MrNetTek
A blog about IT, technical solutions, and code.