From 7f2e9d6d57cc5836998bae518e1dde0a50512ce9 Mon Sep 17 00:00:00 2001 From: Jaap Brasser Date: Fri, 9 Aug 2019 17:04:11 +0200 Subject: [PATCH] Added foreach-object instead intermediate var --- ConvertTo-Base64GUIExample/ConvertTo-Base64GUIExample.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ConvertTo-Base64GUIExample/ConvertTo-Base64GUIExample.ps1 b/ConvertTo-Base64GUIExample/ConvertTo-Base64GUIExample.ps1 index 0491250..4d31b4a 100644 --- a/ConvertTo-Base64GUIExample/ConvertTo-Base64GUIExample.ps1 +++ b/ConvertTo-Base64GUIExample/ConvertTo-Base64GUIExample.ps1 @@ -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) + } } } \ No newline at end of file