<p>I've managed to get my hands on a Powershell one liner that will get all kubernetes secrets and base64 decode them.</p>
<pre><code>kubectl get secrets -o json | ConvertFrom-Json | select -ExpandProperty items | ? data | select -ExpandProperty data | % { $_.PSObject.Properties | % { $_.Name + [System.Environment]::NewLine + [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_.Value)) + [System.Environment]::NewLine + [System.Environment]::NewLine } }
</code></pre>
<p>The above works.
I've been playing with trying to modify this command to work for a single secret like below without luck:</p>
<pre><code>kubectl get secret mysecretname -o json | ConvertFrom-Json | select -ExpandProperty items | ? data | select -ExpandProperty data | % { $_.PSObject.Properties | % { $_.Name + [System.Environment]::NewLine + [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_.Value)) + [System.Environment]::NewLine + [System.Environment]::NewLine } }
</code></pre>
<p>Could someone share their knowledge with me to help me through this one?</p>
<p>thanks</p>

Richie
<p>Thank you @mdaniel your suggestion solved this for me.</p>
<pre><code>kubectl get secret mysecretname -o json | ConvertFrom-Json | select -ExpandProperty data | % { $_.PSObject.Properties | % { $_.Name + [System.Environment]::NewLine + [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_.Value)) + [System.Environment]::NewLine + [System.Environment]::NewLine } }
</code></pre>
