Professional Windows PowerShell

by
Format: Paperback
Pub. Date: 2007-04-23
Publisher(s): Wrox
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $41.99

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

MSH is a new command-line shell for Microsoft server products, including the long-awaited Longhorn server, and will eventually ship with all major Microsoft products, making it the must-know technology MSH will replace current command lines in new Microsoft products and can be used to write shell scripts similar to those used with Unix and Linux Discusses how MSH enables all of the .NET Framework objects to become accessible via scripting, making it a very powerful addition to any developer's or administrator's toolbox Readers are guided through all the ins and outs of MSH and learn how to create powerful solutions; run scripts, programs, and commands; customize the MSH environment; handle data; manage files and disks; and script solutions and .NET objects

Author Biography

Andrew Watt (Aberdeen, Scotland, UK) was on the Windows PowerShell beta program for almost two years before product release. He is a Microsoft Most Valuable Professional, MVP, for SQL Server and is an independent consultant and experienced computer book author. He wrote his first programs in BASIC and 6502 Assembler in 1984 while researching his doctoral thesis.
He is a regular contributor to the Windows PowerShell newsgroup, microsoft.public.windows.powershell, and can be contacted by email at SVGDeveloper@aol.com.

Table of Contents

Introductionp. xv
Acknowledgmentsp. xx
Finding Your Way Around Windows PowerShellp. 1
Getting Started with Windows PowerShellp. 3
Installing Windows PowerShellp. 3
Installing .NET Framework 2.0p. 4
Installing Windows PowerShellp. 7
Starting and Stopping PowerShellp. 8
Starting PowerShellp. 8
Exiting PowerShellp. 10
Startup Optionsp. 10
Finding Available Commandsp. 11
Getting Helpp. 14
Basic Housekeepingp. 17
Case Insensitivityp. 18
What You Get in PowerShellp. 19
Interactive Command Shellp. 19
Cmdletsp. 20
Scripting Languagep. 21
Summaryp. 23
The Need for Windows PowerShellp. 25
Limitations of CMD.exep. 27
Batch Filesp. 28
Inconsistency of Implementationp. 28
Inability to Answer Questionsp. 29
Lack of Integration with GUI Toolsp. 29
The GUI Emphasis in Windowsp. 29
Previous Attempted Solutionsp. 29
Windows Script Hostp. 30
Windows Management Instrumentationp. 30
Summaryp. 31
The Windows PowerShell Approachp. 33
A New Architecturep. 33
.NET Framework-Based Architecturep. 34
Object-Based Architecturep. 35
A New Cross-Tool Approachp. 38
GUI Shell (MMC Layered over PowerShell)p. 39
Command Linep. 39
Command Scriptingp. 41
COM Scriptingp. 43
Namespaces as Drivesp. 45
File System Providerp. 47
Registryp. 47
Aliasesp. 48
Variablesp. 49
Active Directoryp. 50
Certificatesp. 51
Extensibility and Backward Compatibilityp. 51
Aliasesp. 51
Use Existing Utilitiesp. 53
Use Familiar Commandsp. 55
Long Term Roadmap: Complete Coverage in 3 to 5 Yearsp. 55
COM Accessp. 56
WMI Accessp. 56
.NET Class Accessp. 56
Object-Based Approach in PowerShellp. 56
Object-Based Pipelinesp. 56
A Consistent Verb-Noun Naming Schemep. 57
Coping with a Diverse Worldp. 58
Upgrade Path to C#p. 58
Working with Errorsp. 58
Debugging in PowerShellp. 59
Additional PowerShell Featuresp. 59
Extended Wildcardsp. 59
Automatic Variablesp. 60
Summaryp. 62
Using the Interactive Shellp. 63
Windows PowerShell's Two Command Line Parsing Approachesp. 63
Expression Mode Examplesp. 65
Command Mode Examplesp. 66
Mixing Expressions and Commandsp. 69
Exploring a Windows System with Windows PowerShellp. 69
Finding Running Processesp. 69
Filtering Processes Using where-objectp. 71
Filtering Processes Using Wildcardsp. 72
Finding Out about Servicesp. 73
Finding Running Servicesp. 74
Finding Other Windows PowerShell Commandsp. 75
Using Abbreviated Commandsp. 76
Command Completionp. 76
Aliasesp. 77
Working with Object Pipelinesp. 78
Sequences of Commandsp. 78
Filtering Using where-objectp. 79
Sortingp. 81
Groupingp. 83
Pros and Cons of Verbosityp. 85
Interactivep. 85
Stored Commandsp. 87
Summaryp. 87
Using Snapins, Startup Files, and Preferencesp. 89
Startupp. 89
Snapinsp. 90
Profilesp. 97
Profile.ps1p. 98
Aliasesp. 100
The export-alias Cmdletp. 105
The get-alias Cmdletp. 107
The import-alias Cmdletp. 108
The new-alias Cmdletp. 108
The set-alias Cmdletp. 109
The Help Aliasp. 111
Command Completionp. 112
Promptsp. 113
Preference Variablesp. 115
Summaryp. 116
Parametersp. 117
Using Parametersp. 118
Finding Parameters for a Cmdletp. 121
Named Parametersp. 124
Wildcards in Parameter Valuesp. 125
Positional Parametersp. 127
Common Parametersp. 132
Using Variables as Parametersp. 133
Summaryp. 135
Filtering and Formatting Outputp. 137
Using the where-object Cmdletp. 137
Simple Filteringp. 138
Using Multiple Testsp. 140
Using Parameters to where-objectp. 142
The where-object Operatorsp. 144
Using the select-object Cmdletp. 144
Selecting Propertiesp. 145
Expanding Propertiesp. 146
Selecting Unique Valuesp. 147
First and Lastp. 148
Default Formattingp. 151
Using the format-table Cmdletp. 155
Using the property Parameterp. 156
Using the autosize Parameterp. 157
Hiding Table Headersp. 158
Grouping Outputp. 158
Specifying Labels and Column Widthsp. 159
Using the format-list Cmdletp. 161
Using the update-formatdata and update-typedata Cmdletsp. 162
Summaryp. 163
Using Trusting Operationsp. 165
Look Before You Leapp. 166
Using the remove-item Cmdletp. 166
Using the whatif Parameterp. 175
Using the stop-process Cmdletp. 175
Using the stop-service Cmdletp. 178
Using the confirm Parameterp. 180
Using the verbose Parameterp. 181
Summaryp. 182
Retrieving and Working with Datap. 183
Windows PowerShell Providersp. 183
Using the get-psdrive Cmdletp. 184
Using the set-location Cmdletp. 188
Using the passthru Parameterp. 190
Using the get-childitem Cmdletp. 191
Using the get-location Cmdletp. 194
Using the get-content Cmdletp. 196
Using the measure-object Cmdletp. 201
The new-item Cmdletp. 203
The new-psdrive Cmdletp. 204
Summaryp. 205
Scripting with Windows PowerShellp. 207
Enabling Scripts on Your Machinep. 207
Using the read-host Cmdletp. 212
Using the write-host Cmdletp. 214
The Arithmetic Operatorsp. 218
Operator Precedencep. 219
The Assignment Operatorsp. 220
The Comparison Operatorsp. 222
The Logical Operatorsp. 225
The Unary Operatorsp. 226
Using the set-variable and Related Cmdletsp. 227
The set-variable Cmdletp. 228
The new-variable Cmdletp. 229
The get-variable Cmdletp. 230
The clear-variable Cmdletp. 231
The remove-variable Cmdletp. 232
Summaryp. 234
Additional Windows PowerShell Language Constructsp. 235
Arraysp. 235
Creating Typed Arraysp. 239
Modifying the Structure of Arraysp. 241
Working from the End of Arraysp. 245
Concatenating Arraysp. 248
Associative Arraysp. 249
Conditional Expressionsp. 250
The if Statementp. 251
The switch Statementp. 254
Looping Constructsp. 256
The for Loopp. 256
The while Loopp. 258
The do/while Loopp. 259
The foreach Statementp. 260
Summaryp. 262
Processing Textp. 263
The .NET String Classp. 263
Working with String Methodsp. 267
Casting Strings to Other Classesp. 287
URIp. 287
Datetimep. 288
XMLp. 289
Regexp. 289
Summaryp. 291
COM Automationp. 293
Using the new-object Cmdletp. 293
Working with Specific Applicationsp. 294
Working with Internet Explorerp. 294
Working with Windows Script Hostp. 299
Working with Wordp. 301
Working with Excelp. 302
Accessing Data in an Access Databasep. 303
Working with a Network Sharep. 305
Using Synthetic Typesp. 306
Summaryp. 308
Working with .NETp. 309
Windows PowerShell and the .NET Frameworkp. 309
Creating .NET Objectsp. 311
The new-object Cmdletp. 311
Other Techniques to Create New Objectsp. 317
Inspecting Properties and Methodsp. 320
Using the get-member Cmdletp. 320
Using .NET Reflectionp. 324
Using the GetMembers() Methodp. 324
Using the GetMember() Methodp. 326
Using the GetMethods() Methodp. 328
Using the GetMethod() Methodp. 329
Using the GetProperties() Methodp. 330
Using the GetProperty() Methodp. 331
Using System.Type Membersp. 333
Summaryp. 334
Putting Windows PowerShell to Workp. 335
Using Windows PowerShell Tools for Discoveryp. 337
Exploring System Statep. 338
Using the get-location Cmdletp. 338
Handling Errorsp. 345
Namespacesp. 346
PowerShell Aliasesp. 346
PowerShell Functions and Filtersp. 349
PowerShell Variablesp. 350
Exploring the Environment Variablesp. 351
Exploring the Current Application Domainp. 353
Exploring Servicesp. 357
Using the get-service Cmdletp. 358
Using the new-service Cmdletp. 360
Using the restart-service Cmdletp. 361
Using the set-service Cmdletp. 362
Using the start-service Cmdletp. 362
Using the stop-service Cmdletp. 363
Using the suspend-service Cmdletp. 364
Summaryp. 365
Securityp. 367
Minimizing the Default Riskp. 368
The Certificate Namespacep. 374
Signed Scriptsp. 376
Creating a Certificatep. 376
The set-authenticodesignature Cmdletp. 377
The get-authenticodesignature Cmdletp. 379
Summaryp. 379
Working with Errors and Exceptionsp. 381
Errors in PowerShellp. 381
$Errorp. 383
Using Error-Related variablesp. 388
Using the $ErrorView variablep. 389
Using the $ErrorActionPreference variablep. 390
Trap Statementp. 392
Using Common Parametersp. 397
Using the ErrorAction Parameterp. 397
Using the ErrorVariable Parameterp. 399
The write-error Cmdletp. 400
Summaryp. 401
Debuggingp. 403
Handling Syntax Errorsp. 403
The set-PSDebug Cmdletp. 408
The write-debug Cmdletp. 413
Tracingp. 418
The trace-command Cmdletp. 419
The set-tracesource Cmdletp. 422
The get-tracesource Cmdletp. 422
Summaryp. 423
Working with the File Systemp. 425
Path Names in Windows PowerShellp. 426
Fully Qualified Path Namesp. 427
Relative Path Namesp. 430
Path Names and Running Commandsp. 431
Simple Tasks with Folders and Filesp. 434
Finding the drives on a systemp. 434
Finding Folders and Filesp. 434
Finding File Characteristicsp. 436
Exploring Files Using the select-object Cmdletp. 439
Finding Hidden Filesp. 442
Tab Completionp. 443
Redirectionp. 445
Creating Custom Drivesp. 447
Cmdlets for File Actionsp. 449
Using the out-file Cmdletp. 449
Using Cmdlets to Work with Pathsp. 450
Summaryp. 453
Working with the Registryp. 455
Introduction to the Registryp. 455
Exploring the Registry Using Windows PowerShellp. 458
Selecting a Hivep. 458
Navigating to a Desired Keyp. 459
Changing the Registryp. 461
Summaryp. 464
Working with Environment Variablesp. 465
Environment Variables Overviewp. 465
The Environment Command Shell Providerp. 468
Exploring Environment Variablesp. 470
Modifying Environment Variablesp. 471
Summaryp. 473
Language Referencep. 475
Working with Logsp. 477
Event Log Basicsp. 477
The get-eventlog Cmdletp. 480
Summaryp. 494
Working with WMIp. 495
Introducing Windows Management Instrumentationp. 496
Managed Resourcesp. 496
WMI Infrastructurep. 497
CIM Object Managerp. 498
The CIM Repositoryp. 499
WMI Consumersp. 499
WMI Toolsp. 499
Using the get-wmiobject Cmdletp. 502
Finding WMI Classes and Membersp. 506
Exploring a Windows Systemp. 509
Characterizing the CPUp. 509
Finding Memoryp. 510
Exploring Servicesp. 512
Exploring Remote Machinesp. 513
Summaryp. 514
Indexp. 515
Table of Contents provided by Ingram. All Rights Reserved.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.