<p>I'm translating a service manual from Linux to Windows command line, and running into some issues with escape characters. After looking at other entries here and general googling I haven't been able to find anything that works for whatever reason.</p>
<p>In this line:</p>
<blockquote>
<pre><code>kubectl patch serviceaccount default -p '{&quot;imagePullSecrets&quot;: [{&quot;name&quot;: &quot;demo-registry&quot;}]}' -n testNamespace
</code></pre>
</blockquote>
<p>I'm unable to find a combination of <code>`</code>, <code>^</code>, or <code>\</code> that allows me to escape the double quotes. I was able to get it to work in the powershell command below though.</p>
<blockquote>
<pre><code>kubectl patch serviceaccount default -p &quot;{\`&quot;imagePullSecrets\`&quot;: [{\`&quot;name\`&quot;: \`&quot;demo-registry\`&quot;}]}&quot; -n testNamespace
</code></pre>
</blockquote>

Nyyen8
<p>Inverting the &quot; and 's around the inputs allows the command to run without needing escape characters. The errors I had received were in part due to issues with my local environment.</p>
<pre><code>kubectl patch serviceaccount default -p &quot;{'imagePullSecrets': [{'name': 'demo-registry'}]}&quot; -n testNamespace
</code></pre>
