1
0
mirror of https://github.com/jaapbrasser/SharedScripts.git synced 2025-12-24 21:51:38 +02:00

Added first type of GUI

This commit is contained in:
Jaap Brasser
2019-08-09 17:01:32 +02:00
parent ca75b59fc2
commit 92b43b5fdb

View File

@@ -7,8 +7,16 @@ Function to showcase some of the PowerShell GUI capabilities
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
#>
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$InputBox = [Microsoft.VisualBasic.Interaction]::InputBox("Let's convert this to base64", "Sabrina's App", $null)
$InputBox = [convert]::ToBase64String([char[]]$InputBox)
[Microsoft.VisualBasic.Interaction]::MsgBox($InputBox,0,"Sabrina's App")
param(
[string] $Title,
[validateset('VB')]
[string] $GUIType = 'VB'
)
if ('VB' -eq $GUIType) {
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$InputBox = [Microsoft.VisualBasic.Interaction]::InputBox("Let's convert this to base64", $Title, $null)
$InputBox = [convert]::ToBase64String([char[]]$InputBox)
[Microsoft.VisualBasic.Interaction]::MsgBox($InputBox,0,$Title)
}
}