Using the replace operator on a string that has quotes powershell

后端 未结 3 1603
天命终不由人
天命终不由人 2021-01-19 00:44

I am looking to run the command

foreach-object {$_ -replace

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

3条回答
  •  失恋的感觉
    2021-01-19 01:18

    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.:

    'this string "has" quotes'
    

    Note: with single quotes you won't get variable expansion in a string.

提交回复
热议问题