Powershell to the rescue

I am always learning new stuff. A few months ago, I took a membership to Pluralsight and I have so far thoroughly enjoyed it. The courses are really good and there is lots of content available on many different topics.
It has helped me get started with a few things that were on my to-do list for far too long.

One of those things is Powershell. It is only just over a month ago that I started with the awesome Everyday PowerShell for Developers by Jim Christopher, and I now can't imagine how I survived all these years without PS.

Sure, I knew Powershell existed and I knew more or less what it could do. Or so I thought... This course has opened my eyes to how many things I can accomplish much more efficiently using PowerShell vs. GUI-based tools (i.e. clicking with a mouse).

Easy access

The first thing you want is to be able to open Powershell really quickly. There are several options for that. I like the native Windows way Windows + X, I or Windows + X, A for an admin session. However these shortcuts are configured to open a normal prompt shell by default. To enable them to start powershell, you need to open the properties of the Taskbar and change the option under Navigation (the image is from Windows 10, but the option is there in other versions)

taskbar properties

If you don't like that combination, you could of course also assign your own custom shortcut. Search for Powershell in your apps (easy to do in Windows 8 or 10), right click and choose to open the location. This will take you to the powershell shortcut.

explorer window with the shortcuts

In its properties you can set whatever shortcut you want.

properties of Powershell shortcut

There are other ways too. The same way you can type cmd in the location text box of an explorer window you could also type powershell and it will open a session in that directory. So you could do Microsoft + E to open an explorer window, navigate to where you want to go and then use Alt + D to go to the location bar and type powershell.

You could do better though, at least in Windows 8 and 10, you could do Alt + F, R from the explorer window.

What next?

So Powershell is open... what do you want to do next? The sky is the limit really. Powershell has lots of useful comandlets, but it can also run .NET code directly, so you can do pretty much anything. So far I have used it to automate Word (and ease the pain of using it), configure Sitecore instances, modify Visual Studio projects, and in general simplify repetitive tasks.

Just remember you can do Get-Command and Get-Help to explore what is already out there.

To be continued...