<p>I have come across this Helm chart for SQL Server 2017: <a href="https://github.com/helm/charts/tree/master/stable/mssql-linux" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/mssql-linux</a></p>

<p>It looks very useful.  So I have followed the instructions:</p>

<ol>
<li><p><code>helm install --name mymssql stable/mssql-linux --set acceptEula.value=Y --set edition.value=Developer</code></p>

<p>This works as expected i.e. the <code>kubectl</code> commands below it return the expected results.  It then says:</p></li>
<li><p><code>printf $(kubectl get secret --namespace default mymssql-mssql-linux-secret -o jsonpath="{.data.sapassword}" | base64 --decode);echo</code></p></li>
</ol>

<p>I have run this in a command prompt and in Powershell and it just says printf is not recognised (as I expected).  How do I run the printf command on a Windows 10 PC that uses Linux Containers?</p>

<p>I have spent time Googling it, which tells me that printf is a C++ function.  How do I follow step 2?</p>

w0051977
<p>The required data is printed by the <code>kubectl</code> command within the <code>$()</code>. </p>

<p>The base 64 decoding can be done within <code>kubectl</code> itself via Go templates rather than piping the <code>kubectl</code> output into <code>base64</code> (which probably doesn't exist on windows without <a href="https://www.msys2.org/" rel="nofollow noreferrer">mssys</a> installed) </p>

<pre><code>kubectl get secret mymssql-mssql-linux-secret -o go-template='{{.data.sapassword | base64decode}}'
</code></pre>

<p>The <code>printf</code>/<code>echo</code> additions in the example command seem redundant, or at least a bad way to get a newline after the output.  If you find you need a new line to be added on the end of the output on Windows, use the following template </p>

<pre><code>'{{.data.sapassword | base64decode}}{{ "\n" }}'
</code></pre>
