From 5a8031486bad7fa50a99ae3d76dda12bd3a1e3db Mon Sep 17 00:00:00 2001 From: "Jeremy D. Berkleef" Date: Wed, 5 May 2021 08:51:56 -0300 Subject: [PATCH] Replace verification logic with print statement --- alias-toolkit.ps1 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/alias-toolkit.ps1 b/alias-toolkit.ps1 index 77c2b39..4dfc798 100644 --- a/alias-toolkit.ps1 +++ b/alias-toolkit.ps1 @@ -59,18 +59,15 @@ do Set-Mailbox -Identity $Alias.Displayname -EmailAddresses $Alias.EmailAddresses.Split(";") } + #Print the new values to console for verification + Write-Host -ForegroundColor Green -BackgroundColor White "New Values:" + #Get the mailboxes from Exchange and print the email addresses to confirm the changes. Foreach ($Alias in $Alias_list) { $addresses = (Get-Mailbox -Identity $Alias.Displayname).EmailAddresses - if ($addresses -eq $Alias.EmailAddresses) { - Write-Host "$($Alias.Displayname)" -NoNewline - Write-Host -ForegroundColor Green " Success!" - } - else { - Write-Host "$($Alias.Displayname)" -NoNewline - Write-Host -ForegroundColor Red " FAILURE" - } - } + Write-Host -Foregroundcolor Red -Backgroundcolor White (Write-Output $Alias.Displayname); + write-Host -foregroundcolor Green -Separator `n (Write-Output $addresses) + } } '3' { #Ask the user what we're looking for and we're we're going to save the .csv