Tag Archives: Scripting

Last week Mark Minasi presented a webinar made possible by http://www.learnit.com called:“The Case for PowerShell: Why To Learn-PowerShell So You Needn’t Leave-Industry”.The recording can be found here.

In this webinar he explains why ICT administrators need to be(come) familiar with PowerShell. He also explains the basic principles of PowerShell to help lower the threshold for people that have been shying away from command line interfaces (CLI) and scripting in the past. He does this by explaining how PowerShell is different from by example the CLI and Visual Basic Scripting (VBS).

I share his opinion about the necessity to learn PowerShell and therefore I hope I can help spread the message.

With PowerShell it is relatively easy to reverse a string:
$str = “gnirtsdesrever”
$str[-1..-($str.length)] -join “”

Some of you might ask: Why would anyone want to do this ? Well, since the start of the year Usenet DMCA takedowns have begun to occur automatically, very quickly and very often. This means many movies and TV series on Usenet / News Groups are being taken offline very quickly.

At the companies I’ve worked for , disk space on the system disk ran out on a regular basis for some systems and caused a lot of monitor calls. These kind of boring repetitive tasks are always the ones you want to automate.

If you want to take it even a step further, you could automate it even more. By example by automatically running the clean script when an event is generated that the disk is running out of space. You can configure this using by example:

A centralized monitoring solution like System Center Operations Manager (SCOM) with recovery tasks.

Or you could use PowerShell remoting to do it on many systems at the same time. This could come in handy by example when after WSUS patching the content in “C:\Windows\SoftwareDistribution\Download” is not deleted automatically.

Even though I’ve always liked VMWare vSphere, I thought the events and informational messages weren’t always as helpful as they could be.

One of the common things I want to know are the vmotions and storage vmotions that have taken place. Luc Dekens has created a great script that shows the (s)vmotions that have taken place including details about them.

About 6-7 years ago at school we were taught how to script using VBscript. I was really bad at it though and never really made an effort to change that. When PowerShell became more popular however I had gained some working experience and was also pleasantly surprised by the simplicity of it.

I started learning about PowerShell scripting by googling and using script examples. Disadvantages of this approach however is that:

Even though more companies are offshoring and employees are relatively, it is still cheaper to automate instead.

Cost isn’t the only issue, speed is important as well. Scripting allows you to get things done more quickly.

PowerShell is increasingly being adopted by more companies, products and (cloud) services.

The number of available built-in cmdlets are increasing, which makes it even easier to automate actions.

For many products you have to use PowerShell to make specific settings, because only the more basic settings are available in a Graphical User Interface (GUI).

Changes can be applied consistently in a development, test, acceptance, pre-production, production environment.

Less chance of human error.

If done correctly, you’ll also have included a way to quickly revert the changes by script.

To make sure I didn’t miss out on too many things, I decided to start with a book that teaches the basics. Because of the good reputation of the authors Don Jones and Jefferey D. Hicks in the PowerShell community, I decided to go for their book “Learn Windows PowerShell 3 in a month of lunches, second edition” published by Manning Publications Co.

The book’s purposely didn’t try to stuff all PowerShell related information into the book. Instead it provided the reader/student with the basics needed to be able to find/discover this information themselves if needed. I personally like this approach, because otherwise there would be too much information to take in which might be demotivating and distracting.

I also liked the practical examples of common mistakes made by people who are new to PowerShell. There were a lot of examples I ran into as well when I started using PowerShell and I think this will prevent people from becoming frustrated because they understand why things aren’t working the way they might have expected.

All in all this is a great book to start learning PowerShell. This is however just the start and you should expect to continue using other resources/books to further your knowledge. The book also provides links to useful resources as well. And most importantly … start using PowerShell more so you will learn by experience.

Personally I still have these books lying around, but haven’t decided yet which one to start with next: