Windows PowerShell 3.0 Step by Step - Cdn.oreilly.com - O'Reilly
Windows PowerShell 3.0 Step by Step - Cdn.oreilly.com - O'Reilly
Windows PowerShell 3.0 Step by Step - Cdn.oreilly.com - O'Reilly
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 7 Creating Advanced Functions and Modules 209<br />
The [cmdletbinding] attribute .....................................209<br />
Easy verbose messages .....................................210<br />
Automatic parameter checks ................................211<br />
Adding support for the -whatif parameter ....................214<br />
Adding support for the -confirm parameter ...................215<br />
Specifying the default parameter set .........................216<br />
The parameter attribute ..........................................217<br />
The mandatory parameter property ..........................217<br />
The position parameter property ............................218<br />
The ParameterSetName parameter property ..................219<br />
The ValueFromPipeline property .............................220<br />
The HelpMessage property .................................221<br />
Understanding modules .........................................222<br />
Locating and loading modules ....................................222<br />
Listing available modules ...................................223<br />
Loading modules ..........................................225<br />
Installing modules ...............................................227<br />
Creating a per-user Modules folder ..........................227<br />
Working with the $modulePath variable ......................230<br />
Creating a module drive ....................................232<br />
Checking for module dependencies ..........................234<br />
Using a module from a share ................................237<br />
Creating a module ..............................................238<br />
Creating an advanced function: step-<strong>by</strong>-step exercises ..............245<br />
Chapter 7 quick reference ........................................249<br />
Chapter 8 Using the <strong>Windows</strong> <strong>PowerShell</strong> ISE 251<br />
Running the <strong>Windows</strong> <strong>PowerShell</strong> ISE ..............................251<br />
Navigating the <strong>Windows</strong> <strong>PowerShell</strong> ISE ......................252<br />
Working with the script pane ................................254<br />
Tab expansion and IntelliSense ..............................256<br />
Contents xi