Created
          April 5, 2017 09:27 
        
      - 
      
 - 
        
Save marcgeld/160dc0c917703b9256548429a66184b0 to your computer and use it in GitHub Desktop.  
    Powershell: base64 encode / decode
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # base64 encode / decode | |
| $bytes = [System.Text.Encoding]::UTF8.GetBytes( "Write-Host Hello World") | |
| $base64 = [Convert]::ToBase64String( $bytes ) | |
| Write-Host "Base64 encoded: "( $base64 ) | |
| $base64Decoded = [Convert]::FromBase64String( $base64 ) | |
| Write-Host "Base64 decoded: "( $base64Decoded ) | |
| $decodedText = [System.Text.Encoding]::UTF8.GetString( $base64Decoded ) | |
| Write-Host "Base64 decoded string: "( $decodedText ) | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment