Datasheet

36 CHAPTER 1
USING POWERSHELL WITH ACTIVE DIRECTORY
To change the
.ps1
le association, do the following:
1. Open the Control Panel, and run the Default Programs applet.
2. When the Default Programs applet launches, select the option Associate A
File Type Or Protocol With A Program.
3. Scroll down to the
.ps1
le extension, and click it to select it. Click the
Change Program button above the list of  le types, as shown in Figure 1.12.
FIGURE 1.12 Changing the default program for PowerShell scripts
4. When the Open With dialog opens, click the Browse button to locate the
PowerShell executable.  is executable is stored at
C:\Windows\System32\
WindowsPowerShell\v1.0\powershell.exe
. Select the
powershell
.exe
le, and click Open to choose it.
5. Click OK in the Open With dialog to choose Windows PowerShell and set the
le association.
6. Close the Default Programs applet and any remaining windows. Now, when
you double-click a
.ps1
le, it will launch with PowerShell instead of Notepad.
c01.indd 36c01.indd 36 5/12/2011 1:07:53 PM5/12/2011 1:07:53 PM