Following keyword need to be searched on document using PowerShell:
["Allowed Acquisition Clean-Up Period"
$keyword = ""
Get-Content $SourceFileName | Select-String -Pattern $keyword
String which I'm searching for has double quotes in it, so I'm struggling how to mention in this $keyword
.
Apparently you not only have double quotes, but also an opening square bracket. Square brackets are meta-characters in regular expressions (for defining character classes), so you need to escape those too.
Define your expression in single quotes:
$keyword = '\["Allowed Acquisition Clean-Up Period"'
or escape nested double quotes with backticks:
$keyword = "\[`"Allowed Acquisition Clean-Up Period`""