Skip to content

Instantly share code, notes, and snippets.

@brandedoutcast
Created November 22, 2018 07:22
Show Gist options
  • Save brandedoutcast/08eb3191a0b71389f0948edd00637e8e to your computer and use it in GitHub Desktop.
Save brandedoutcast/08eb3191a0b71389f0948edd00637e8e to your computer and use it in GitHub Desktop.
Decode kubectl secrets in PowerShell
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 } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment