Using the replace operator on a string that has quotes powershell

Question:

I am looking to run the command

However the string I am attempting to work with could be described as the follow

the whole line being

How do I make this quote filled line work with powershell?

Answer:

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.

Source:

Using the replace operator on a string that has quotes powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply