Hey, Scripting Guy! Weekend Scripter: The Scripting Wife Gets Started with Windows PowerShell
Microsoft Scripting Guy Ed Wilson here. Spring has definitely sprung in Charlotte, North Carolina, in the southern part of the United States. Our clocks have been set forward for several weeks now, and the days seem to begin earlier than they did before the change. With more time in the day, it provides a tremendous opportunity to get into shape for the 2010 Scripting Games. The Scripting Wife, who will be competing in this year’s beginner category, is starting from scratch—quite literally. Though she has proofread all four of my Microsoft Press Windows PowerShell scripting books, she claims not to have paid attention to the text, other than from a grammatical point of view. After seeing the cool things Windows PowerShell can do, up close and personal for the last couple of years, she is itching to give it a go.
Because her primary computer is an older computer in the kitchen, it still runs Windows XP. The Scripting Wife’s computer is running Service Pack 3, and she took all of the defaults when she recently rebuilt the computer. The first thing to do is to run Windows Update and check for any updates—she always does this, even though she has enabled automatic updates. Keep in mind that if you have not installed updates for a while, the process might consume a considerable amount of time. In addition, Internet Explorer 8 is automatically selected and will be downloaded if you select the defaults. Internet Explorer 8 presents an additional agreement. It also checks for additional updates during its installation. If you do not pay attention to Windows Update during the installation process, the updating procedure will appear to hang for a very long time. In fact, it is waiting for you to click through a couple of screens for the Internet Explorer installation. Microsoft Update is seen in the following image.
The Scripting Wife knows that the easiest way to find Windows PowerShell 2.0 is to go to the Scripting Guys Web site, click the Downloads tab, and then click Download Windows PowerShell 2.0, as shown in the following image.
The Windows PowerShell 2.0 bits are in a package called the Windows Management Framework, and they include updates to WinRM and BITS along with the Windows PowerShell 2.0 files. Because Windows PowerShell 2.0 can use both WinRM and BITS, the inclusion of a single package makes it really convenient to get the files. The Windows XP package is near the bottom of the page. The Windows XP package also works on Windows Embedded.
Double-clicking the 5 MB file causes the package to expand. An error then appears stating that the .NET Framework 2.0 with SP1 needs to be installed. The error message is shown in the following image.
Unfortunately, though the error message does list the URL for the .NET Framework 2.0 SP1 file, it does not include a hyperlink to initiate the installation. The Scripting Wife therefore goes back to Windows Update (Start/All Programs/Windows Update), clicks Optional Updates, and chooses the .NET Framework 3.5 Service Pack 1 update. She hopes this will provide her with the necessary files; otherwise, she will have to resort to searching the Microsoft Download Center. The .NET Framework 3.5 SP1 update is a 69 MB download, and therefore does not take too horribly long to download. The installation takes a bit longer because of the expansion of the compressed files in the package. The Windows Update package worked, and now she once again double-clicks the WindowsXP-KB968930-x86-ENG file and the installation proceeds. This is shown in the following image.
The installation successfully completes as shown in the following image.
No reboot was requested, but no visible changes were made to the system. The Scripting Wife clicks Start, All Programs, Accessories, and at the bottom of the list, she finds the Windows PowerShell folder. She clicks it, and then clicks Windows PowerShell. This is shown in the following image.
After Windows PowerShell 2.0 is running, the Scripting Wife types Get-Pr and presses TAB. Tab expansion completes the Get-Process command, and she is able to see the results displayed in the Windows PowerShell console. She has typed her first Windows PowerShell command and received a listing of all the processes on her computer! Now if the Scripting Wife only knew what a process was. Maybe later I will introduce her to the Windows Internals book. Much later. The results of the Scripting Wife’s first command are shown in the following image.
How did the Scripting Wife know she could type Get-Process? She read Windows PowerShell: An Introduction. Tomorrow, the Scripting Wife will begin exploring Windows PowerShell to see what she can do with it. Join us then as we chronicle her trials and tribulations.
If you want to know exactly what we will be looking at tomorrow, follow us on Twitter or Facebook. If you have any questions, send e-mail to us at firstname.lastname@example.org or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.
Ed Wilson and Craig Liebendorfer, Scripting Guys