ptg
17 Administering SQL Server 2008 with PowerShell 481
What’s New with PowerShell......................................................................481
Overview of PowerShell . ............................................................................482
Start Using PowerShell Now..............................................................483
Common Terminology . ....................................................................483
Object-Based Functionality . .............................................................484
SQL Server Management Objects ......................................................484
WMI . .................................................................................................484
Installing PowerShell . .......................................................................485
PowerShell Console . .........................................................................485
Scriptable and Interactive. ................................................................486
Default Security . ...............................................................................486
Execution Policy . ..............................................................................487
Profiles . .............................................................................................487
Built-in Help Features . ......................................................................487
PowerShell Scripting Basics. .......................................................................490
A Few Basic Cmdlets..........................................................................490
Creating a PowerShell Script .............................................................491
Adding Comments . ..........................................................................491
Variables . ...........................................................................................491
Escaping Characters. .........................................................................492
Special Variable $_ . ...........................................................................493
Joining Variables and Strings ............................................................493
Passing Arguments. ...........................................................................494
Using Param. .....................................................................................494
Arrays . ...............................................................................................495
Operators . .........................................................................................496
Conditional Statements.....................................................................496
Functions . .........................................................................................497
Looping Statements . .........................................................................498
Filtering Cmdlets . .............................................................................499
Formatting Cmdlets. .........................................................................500
Dealing with CSV Files ......................................................................501
Dealing with Dates and Times ..........................................................502
-WhatIf/-Confirm Parameters............................................................503
PowerShell in SQL Server 2008. .................................................................503
Adding PowerShell Support...............................................................503
Accessing PowerShell. .......................................................................505
SQL Server PowerShell . .....................................................................506
SQL Provider . ....................................................................................507
SQL Cmdlets . ....................................................................................508
SQL Server Agent Support .................................................................509
xiv
Download from www.wowebook.com