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

Added foreach-object instead intermediate var

This commit is contained in:
Jaap Brasser
2019-08-09 17:04:11 +02:00
parent 92b43b5fdb
commit 7f2e9d6d57

View File

@@ -15,8 +15,8 @@ param(
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)
[Microsoft.VisualBasic.Interaction]::InputBox("Let's convert this to base64", $Title, $null) | ForEach-Object {
[Microsoft.VisualBasic.Interaction]::MsgBox([convert]::ToBase64String([char[]]$_),0,$Title)
}
}
}