{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5982","repository_url":"https://api.github.com/repos/PowerShell/PowerShell","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5982/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5982/comments","events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5982/events","html_url":"https://github.com/PowerShell/PowerShell/issues/5982","id":290584974,"node_id":"MDU6SXNzdWUyOTA1ODQ5NzQ=","number":5982,"title":"ConvertFrom-Base64, ConvertTo-Base64","user":{"login":"felixfbecker","id":10532611,"node_id":"MDQ6VXNlcjEwNTMyNjEx","avatar_url":"https://avatars0.githubusercontent.com/u/10532611?v=4","gravatar_id":"","url":"https://api.github.com/users/felixfbecker","html_url":"https://github.com/felixfbecker","followers_url":"https://api.github.com/users/felixfbecker/followers","following_url":"https://api.github.com/users/felixfbecker/following{/other_user}","gists_url":"https://api.github.com/users/felixfbecker/gists{/gist_id}","starred_url":"https://api.github.com/users/felixfbecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixfbecker/subscriptions","organizations_url":"https://api.github.com/users/felixfbecker/orgs","repos_url":"https://api.github.com/users/felixfbecker/repos","events_url":"https://api.github.com/users/felixfbecker/events{/privacy}","received_events_url":"https://api.github.com/users/felixfbecker/received_events","type":"User","site_admin":false},"labels":[{"id":311043050,"node_id":"MDU6TGFiZWwzMTEwNDMwNTA=","url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Issue-Enhancement","name":"Issue-Enhancement","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-01-22T19:24:08Z","updated_at":"2018-12-12T19:31:38Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently to decode/encode Base64 we have to call into cumbersome .NET APIs:\r\n\r\n```powershell\r\n[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('aGVsbG8gd29ybGQK'))\r\n```\r\n\r\nBase64 is needed in a lot of cases. For example, getting a secret value out of `kubectl` is incredibly cumbersome:\r\n\r\n```powershell\r\n[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String((kubectl get secret database -o json | ConvertFrom-Json).data.username))\r\n```\r\n\r\nIt would be great if we could just do this:\r\n\r\n```powershell\r\n(kubectl get secret database -o json | ConvertFrom-Json).data.username | ConvertFrom-Base64\r\n```\r\n\r\nThis is something that is available on every Unix shell with the `base64` utility (which can be piped into).\r\n\r\nThere is a Base64 module on PSGallery, but given this is available in .NET and Unix shells imo it should be exposed as a convenient PS cmdlet, so it is available in all installations and reliable.\r\n\r\nFor example, the Base64 module on PSGallery always uses UTF16 so the above example just results in mangled characters. A core implementation should support the standard `-Encoding` parameter etc.\r\n\r\nThis is unlikely to create a maintenance burden because it just calls into .NET and the Base64 spec will not change."},"comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments/446714398","html_url":"https://github.com/PowerShell/PowerShell/issues/5982#issuecomment-446714398","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5982","id":446714398,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjcxNDM5OA==","user":{"login":"chriskuech","id":3680671,"node_id":"MDQ6VXNlcjM2ODA2NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/3680671?v=4","gravatar_id":"","url":"https://api.github.com/users/chriskuech","html_url":"https://github.com/chriskuech","followers_url":"https://api.github.com/users/chriskuech/followers","following_url":"https://api.github.com/users/chriskuech/following{/other_user}","gists_url":"https://api.github.com/users/chriskuech/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskuech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskuech/subscriptions","organizations_url":"https://api.github.com/users/chriskuech/orgs","repos_url":"https://api.github.com/users/chriskuech/repos","events_url":"https://api.github.com/users/chriskuech/events{/privacy}","received_events_url":"https://api.github.com/users/chriskuech/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T19:31:38Z","updated_at":"2018-12-12T19:31:38Z","author_association":"NONE","body":"What would an approved interface for this cmdlet look like?"}}
{"actor":{"display_login":"chriskuech"}}