I am looking to run the command
foreach-object {$_ -replace
However the string I am attempting to work with could be described as the follow
this string "has" quotes
the whole line being
foreach-object {$_ -replace "this string "has" quotes", "this string "won't have" quotes"}
How do I make this quote filled line work with powershell?
You can either escape the nested double quotes like so
`"or better yet, use single quotes for quoting of the string then you won’t need to escape the double quotes e.g.:Note: with single quotes you won’t get variable expansion in a string.