Tag streams

Updating a distribution list with error handling

This morning I woke up to a query whether we could do a bulk addition of users (with email addresses) to a distribution list. The team got a list of users to add and the name of the distribution group as part of the request. The administrators would then copy-paste the email column to a new CSV file, place the file on the desktop and run a one-liner. Import-Csv "C:\Users\USER88398\Desktop\book1.csv" | ForEach-Object { Add-DistributionGroupMember "DL-DistributionGroup070818" -Member $_.

Understanding streams in PowerShell

In the past, we have spoken about how cmdlets output objects, and how output can be piped from one cmdlet to another. If you ever encountered errors or warnings or verbose output in the execution that involved outputting content to a file, these errors, warnings, verbose outputs… none of them is passed through the pipe into, say, the export cmdlet. Ever wondered why? Enter: Streams Output redirection Out-Host Read-Host The Information stream Redirecting output across streams Wrapping up I speak about the nature of output in PowerShell, in my book: