Windows PowerShell 3.0 First Steps: Part 1

Windows PowerShell 3.0 First Steps: Part 1

  • Comments 3
  • Likes

Summary: Microsoft Scripting Guy, Ed Wilson, shares a portion from his popular Microsoft Press book Windows PowerShell 3.0 First Steps.

Microsoft Scripting Guy, Ed Wilson, is here. Today I want to share with you a portion from my new book, Windows PowerShell 3.0 First Steps, which was recently released by Microsoft Press.

Understanding Windows PowerShell

Windows PowerShell comes in two flavors—the first is an interactive console (sort of like a KORN or a BASH console in the UNIX world) that is built into the Windows command prompt. The Windows PowerShell console makes it simple to type short commands and to receive sorted, filtered, formatted results. These results easily display to the console, but can redirect to XML, CSV, or text files. The Windows PowerShell console offers several advantages, such as speed, low memory overhead, and a comprehensive transcription service that records all commands and command output.

There is also the Windows PowerShell ISE. The Windows PowerShell ISE is an integrated scripting environment, but this does not mean you must use it to write scripts. In fact, many Windows PowerShell users like to write their script in the Windows PowerShell ISE to take advantage of the color syntax highlighting, drop-down lists, and automatic parameter revelation features. In addition, the Windows PowerShell ISE has a feature called the Show Command Add-On, which permits using a mouse to create Windows PowerShell commands from a graphical environment. After created, the command runs directly or is added to the script pane (the choice is up to you). For more information about using the Windows PowerShell ISE, see Chapter 10, Using the Windows PowerShell ISE.

Note  For simplicity, when working with single commands, I show the command and results from within the Windows PowerShell console. But keep in mind that all of the commands also run from within the Windows PowerShell ISE. Whether the command runs in the Windows PowerShell console, in the Windows PowerShell ISE, as a scheduled task, or as a filter for Group Policy, PowerShell is PowerShell is PowerShell. In its most basic form, a Windows PowerShell script is simply a collection of Windows PowerShell commands.

Working with Windows PowerShell

In Windows Server 2012 or Windows 8, Windows PowerShell 3.0 already exists. In Windows 8, you only need to type the first few letters of the word PowerShell on the Start screen before Windows PowerShell appears as an option. The following image illustrates this point. I only typed pow before the Start screen search box changed to offer Windows PowerShell and an option.

Image of screen

Because navigating to the Start screen and typing pow each time I want to launch Windows PowerShell is a bit cumbersome, I prefer to pin the Windows PowerShell console (and the Windows PowerShell ISE) to the Start page and to the Windows desktop taskbar. This technique of pinning shortcuts to the applications provides single-click access to Windows PowerShell from wherever I may be working.

Image of screen

In Windows Server 2012, it is not necessary to go through the “Start screen, then Search” routine because an icon for the Windows PowerShell console exists by default on the taskbar of the desktop.

Join me tomorrow when I will have another excerpt from my book, Windows PowerShell 3.0 First Steps.

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

Ed Wilson, Microsoft Scripting Guy 

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • I bought a copy of "Windows PowerShell 3.0 First Steps" for each of my colleagues starting to learn Powershell - Thank you!

  • @Nicholas Dambrosio, Thank you I hope your colleagues enjoy them and can apply what they learn to be more efficient and because they love PowerShell.

  • Great guide!

    Powershell is awesome! I used to fear the shell but now love it :)