This file contains 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
# Open a file dialog for the user to choose an image | |
Add-Type -AssemblyName System.Windows.Forms | |
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
$OpenFileDialog.ShowDialog() | Out-Null | |
$image_path = $OpenFileDialog.FileName | |
# Read the image file and convert it to a base64 string | |
$ImageBytes = [System.IO.File]::ReadAllBytes($image_path) | |
$Base64Image = [System.Convert]::ToBase64String($ImageBytes) |