Created
July 18, 2025 12:04
-
-
Save stopthatastronaut/ef53078be69009c634356452efb693f2 to your computer and use it in GitHub Desktop.
Convert-Base64 PowerShell function
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
Function Convert-Base64 { | |
param([string]$instring) | |
# Convert string to byte array | |
$bytes = [System.Text.Encoding]::UTF8.GetBytes($instring) | |
# Convert byte array to Base64 string | |
$base64String = [System.Convert]::ToBase64String($bytes) | |
# Output the Base64 string | |
return $base64String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment