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 $_.

How to run a PowerShell script

Often, administrators face situations where they run scripts written by someone else. After all, that is what a community is all about. When the admin is new to PowerShell, and when he does not understand how to run a PowerShell script, he feels a little lost. And this is normal. I often meet administrators who are unsure how to run a script. How to run the function within the script Calling functions outside of the script Other methods of loading functions Calling a function without loading it into the session Loading the function into the session Summary Now, sometimes, the approach I used to take was to write the script in such a way that the moment someone calls it either from the console or using one of the integrated environments, the script would run and complete its task.

How I build my blog (part 2)

In the previous post, I showed how I have set up the build of the site. The process is incomplete without deployment. As already said, the deployment happens to AWS S3, and here is how: Deploy the site to AWS S3 Configure the S3 bucket Setup AWS Access and Secret keys Configure CloudFront to deliver the site Configure DNS routing Set up GitLab CI for S3 deployment Summary Deploy the site to AWS S3 I wrote a Gist for this task using BitBucket, Wercker (CI) and AWS S3 back in July 2017.

How I build my blog (part 1)

It has been some time since I started using Jekyll, because of my frustration with CMS like Blogger and WordPress. I picked up Jekyll and learned it because I wanted complete control over how I build my site, where I write some fiction (go, check it out if it interests you). I wanted to control the design, the content, the features, pretty much everything. The code is available on GitLab.

How do you write scripts?

PowerShell is easy to learn. Like I said in the previous post, PowerShell is among the easiest languages to learn. Now, like mentioned in the previous post, you learnt to use the pipeline, and now, you are a one-liner star. But how do you go about writing full-blown scripts? You may have seen scripts running hundreds or thousands of lines. How do you write a complete script in PowerShell? Do you write every line of it?