• Complain

Don Jones - Windows PowerShell Scripting and Toolmaking

Here you can read online Don Jones - Windows PowerShell Scripting and Toolmaking full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2011, publisher: Concentrated Technology and Interface Technical Training, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Don Jones Windows PowerShell Scripting and Toolmaking
  • Book:
    Windows PowerShell Scripting and Toolmaking
  • Author:
  • Publisher:
    Concentrated Technology and Interface Technical Training
  • Genre:
  • Year:
    2011
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Windows PowerShell Scripting and Toolmaking: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Windows PowerShell Scripting and Toolmaking" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Don Jones: author's other books


Who wrote Windows PowerShell Scripting and Toolmaking? Find out the surname, the name of the author of the book and a list of all author's works by series.

Windows PowerShell Scripting and Toolmaking — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Windows PowerShell Scripting and Toolmaking" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Windows PowerShell Scripting and Toolmaking

Don Jones

Windows PowerShell
Scripting and Toolmaking

Don Jones

Copyright 2011 by Don Jones

http://ConcentratedTech.com

for Companion Materials, visit
http://MoreLunches.com

First Printing: October 2011
Available in Print at Lulu.com
Available Electronically through Major eBook Stores

eBook Edition

ISBN 978-1-105-08285-6

Cover design by Greg Richard

Published in cooperation with Interface Technical Training
http://InterfaceTT.com

Windows PowerShell Scripting and Toolmaking

Introduction

Typesetting Standards
Editing Scripts
An Organic Approach
Welcome to Tier 2

Acknowledgements

Scripting Overview

PowerShell Script Files
Variables
Quotation Marks
Object Members and Variables
Parentheses
Scope
PowerShell Scripting Language
If Construct
Do...While Construct
ForEach Construct
Other Constructs
Functions
Adding Parameters to a Script
Advanced Scripts
Conclusion

Advanced Functions

Advanced Function Template
Designing the Function
Declaring Parameters
Testing the Parameters
Writing the Main Code
Outputting Custom Objects
Continuing With the Advanced Function
Testing the Function
Conclusion

Advanced Functions, Advanced

Testing, Testing, Testing
Verbose and Debug Output
Parameter Aliases
Parameter Validation
Parameter Help
Parameter Sets
Designing Functions
Conclusion

Error Handling

It's All About the Action
Setting the Error Action
Saving the Error
Error Handling v1: The Trap Construct
Try...Catch...Finally

Debugging

Two Types of Bugs
Solving Typos
Dealing with Logic Errors: Trace Code
Dealing with Logic Errors: Breakpoints
The Real Trick to Debugging

Custom Formatting

The Anatomy of a View
Adding a Type Name to Output Objects
Making a View
Loading the View
Problems at this Point

Script and Manifest Modules

Introducing Modules
Creating a Module Manifest
Creating a Module-Level Setting Variable

Writing Help

Comment-Based Help
XML-Based Help

Using Databases

Simplifying Database Access
Setting Up Your Environment
The Database Functions
About the Database Functions
Using the Database Functions
Closing Thoughts

A Final Lesson: Script Design

Appendix: Best Practices

Introduction

Windows PowerShell continues to take the world by storm, showing up in an increasing number of Microsoft and even third-party products.

After the success of my for-beginners PowerShell book, Learn Windows PowerShell in a Month of Lunches, I started receiving requests for a more advanced book. Unfortunately, the more advanced topics dont really lend themselves to the read-it-in-an-hour format of the Lunches series, so I couldnt do a direct sequel. So I wrote this book instead, to at least partially address those more advanced stuff requests.

In order to make this a standalone book, I had to overlap a bit with the Lunches book. However, this book definitely tells a story: Youll start with a single project goal, and continue to build upon it throughout the book. By the end, youll have built a complete set of tools, using only Windows PowerShell, and be able to distribute them to your colleagues.

Before we get started, lets cover some of the typesetting standards Ive used in this book.

Typesetting Standards

To make PowerShell commands (and other things youre meant to type into the shell) stand out, Ill set those out in monospaced font, such as Get-WmiObject .

Code listings can always be difficult in a book especially in todays electronic readers, which re-flow text and may cause word-wrapping to occur when it shouldnt. Electronic readers make it especially tough, because in most cases they dont support fixed-width fonts. For that reason, Ill present code listings in a bulleted format:

Listing X-X: An example

function MyFunction {
Get-WmiObject -class Win32_OperatingSystem -computername localhost
}

Exactly what that looks like will depend upon the font size in your electronic reader. Basically, each numbered line should be typed as a single physical line into your script editor even if it wraps onto multiple lines here in this book. Dont type the bullets themselves, though.

To help you out, any listing longer than two or three lines will have a listing number (Listing 1-2, for example), and will be downloadable from http://MoreLunches.com . Just find this books cover image on the front page, click it, and youll be taken to a page that offers downloads and other companion resources. Ill include all of the scripts for this entire book in a single ZIP file.

Editing Scripts

I strongly encourage you to obtain a script editor.

While the PowerShell ISE that comes with Windows is fine, it offers a minimal set of features and isnt really suited to the hardcore scripting youll do in this book. SAPIEN PrimalScript (primalscript.com), Idera PowerShell Plus (idera.com), PowerGUI (powergui.org), and PowerSE (powerwf.com) are all excellent editors. PowerGUI is even available in a free edition. Note that I dont recommend more generic editors that cant also run your scripts. We dont need just editing we also need the ability to execute the things!

All the script editors Ive mentioned offer free trial periods, so you can try them and see which ones you like. They each take a slightly different approach, so its worth your while to give them a spin to find which ones make the most sense to you.

I dont recommend the use of generic script editors that merely offer syntax coloring. You really need something PowerShell-specific, which offers syntax highlighting, code hinting and completion, and most especially debugging features. PowerGUI, as Ive pointed out, is free; you dont need to spend anything to get something thats light-years better than the PowerShell ISE or Notepad.

An Organic Approach

I tend to dislike books that simply feed the correct answers to the reader. In terms of learning something new, there's tremendous value in playing with it, making mistakes and learning from those mistakes. It's the way our brains work, which is why it's sometimes called "organic" learning. Rather than learning like a machine, which expects the correct set of instructions the first time, we as humans tend to learn like... well, like humans, making mistakes and adjusting ourselves appropriately.

This book will definitely follow an organic approach. Because this is a book, and not a live experiment, that approach may sometimes seem artificial. After all, why would I show you the wrong way to do something, when I could just as easily start out by showing you the right way? Because seeing the wrong way is sometimes more valuable. Showing you something that doesn't work, and explaining why, will help you better understand how it works, which will help you better use that something on your own in the future.

So I ask that you trust me, and follow along. Run the commands and scripts that I provide as examples. Don't just take my word for what they do! See it for yourself! Sometimes, things won't work out properly. And when that happens, see if you can figure out why. At the very least, try to form a theory about why something broke. I'll always give you the full explanation, but by at least trying to form a theory on your own, you'll be forcing your brain to analyze what you've done, which helps you learn faster.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Windows PowerShell Scripting and Toolmaking»

Look at similar books to Windows PowerShell Scripting and Toolmaking. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Windows PowerShell Scripting and Toolmaking»

Discussion, reviews of the book Windows PowerShell Scripting and Toolmaking and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.