1
0
mirror of https://github.com/jaapbrasser/SharedScripts.git synced 2025-12-24 21:51:38 +02:00
Files
SharedScripts/ConvertTo-Base64GUIExample/ConvertTo-Base64GUIExample.ps1
2019-08-09 17:04:11 +02:00

22 lines
804 B
PowerShell

function ConvertTo-Base64GUIExample {
<#
.SYNOPSIS
Function to showcase some of the PowerShell GUI capabilities
.DESCRIPTION
This function contains various examples of using the GUI capabilities of both Windows PowerShell and PowerShell (Core). This is inteded to be used as a reference for those interested in building basic GUIs with PowerShell
#>
param(
[string] $Title,
[validateset('VB')]
[string] $GUIType = 'VB'
)
if ('VB' -eq $GUIType) {
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
[Microsoft.VisualBasic.Interaction]::InputBox("Let's convert this to base64", $Title, $null) | ForEach-Object {
[Microsoft.VisualBasic.Interaction]::MsgBox([convert]::ToBase64String([char[]]$_),0,$Title)
}
}
}