Mastering Windows PowerShell Scripting

Master the art of automating and managing your Windows environment using PowerShell
Preview in Mapt

Mastering Windows PowerShell Scripting

Brenton J.W. Blawat

1 customer reviews
Master the art of automating and managing your Windows environment using PowerShell
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Mastering Windows PowerShell Scripting Book Cover
Mastering Windows PowerShell Scripting
$ 39.99
$ 28.00
Mastering Windows PowerShell 5 Administration [Video] Book Cover
Mastering Windows PowerShell 5 Administration [Video]
$ 104.99
$ 89.25
Buy 2 for $35.00
Save $109.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781782173557
Paperback282 pages

Book Description

PowerShell is quickly becoming the de facto standard for scripting in Microsoft Windows environments. It enables the automation of otherwise complex tasks, providing interactivity between different products.

Beginning with PowerShell fundamentals, this book progresses by imparting the advanced skills required to master automation. You will learn how to deal with data and operations on various data types and structures, and see the techniques of data manipulation and parsing. Moving on, you will learn about the usage of regular expressions and comparison operators. Error handling techniques will enable you to identify and eliminate errors. This book also provides best practices for scripting and techniques to reduce the amount of code required to complete tasks.

By the end of this book, you will be able to create a variety of PowerShell scripts and successfully automate your environment and become the go-to person.

Table of Contents

Chapter 1: Variables, Arrays, and Hashes
Variables
Arrays
Hashes
Deciding the best container for your scripts
Summary
Chapter 2: Data Parsing and Manipulation
String manipulation
Number manipulation and parsing
Date and time manipulation
Forcing data types
Piping variables
Summary
Chapter 3: Comparison Operators
Comparison operator basics
Equal and not equal comparison
Greater than and less than comparison
Contains, like, and match operators
And / OR comparison operators
Best practices for comparison operators
Summary
Chapter 4: Functions, Switches, and Loops Structures
Functions
Looping structures
Switches
Combining the use of functions, switches, and loops
Best practices for functions, switches, and loops
Summary
Chapter 5: Regular Expressions
Getting started with regular expressions
Regular expression grouping constructs and ranges
Regular expression quantifiers
Regular expression anchors
Regular expressions examples
Summary
Chapter 6: Error and Exception Handling and Testing Code
Error and exception handling – parameters
Error and exception handling – Try/Catch
Error and exception handling – legacy exception handling
Methodologies for testing code
Summary
Chapter 7: Session-based Remote Management
Utilizing CIM sessions
Summary
Chapter 8: Managing Files, Folders, and Registry Items
Registry provider
Creating files, folders, and registry items with PowerShell
Adding named values to registry keys
Verifying files, folders, and registry items
Copying and moving files and folders
Renaming files, folders, registry keys, and named values
Deleting files, folders, registry keys, and named values
Summary
Chapter 9: File, Folder, and Registry Attributes, ACLs, and Properties
Retrieving attributes and properties
Viewing file and folder extended attributes
Setting the mode and extended file and folder attributes
Managing file, folder, and registry permissions
Summary
Chapter 10: Windows Management Instrumentation
WMI structure
Using WMI objects
Searching for WMI classes
Creating, modifying, and removing WMI property instances
Invoking WMI class methods
Summary
Chapter 11: XML Manipulation
XML file structure
Summary
Chapter 12: Managing Microsoft Systems with PowerShell
Managing local users and groups
Managing Windows services
Managing Windows processes
Installing Windows features and roles
Summary
Chapter 13: Automation of the Environment
Invoking programs for automation
Using desired state configuration
Detecting and restoring drifting configurations
Summary
Chapter 14: Script Creation Best Practices and Conclusion
Best practices for script management
# commenting headers
Best practices for script creation
Best practices for software automation
Summary

What You Will Learn

  • Utilize variables, hashes, and arrays to store data
  • Parse and manipulate different data types
  • Optimize code through the use of functions, switches, and looping structures
  • Create and implement regular expressions in PowerShell scripts
  • Leverage session-based remote management
  • Manage files, folders, and registries through the use of PowerShell
  • Discover the best practices to manage Microsoft systems

Authors

Table of Contents

Chapter 1: Variables, Arrays, and Hashes
Variables
Arrays
Hashes
Deciding the best container for your scripts
Summary
Chapter 2: Data Parsing and Manipulation
String manipulation
Number manipulation and parsing
Date and time manipulation
Forcing data types
Piping variables
Summary
Chapter 3: Comparison Operators
Comparison operator basics
Equal and not equal comparison
Greater than and less than comparison
Contains, like, and match operators
And / OR comparison operators
Best practices for comparison operators
Summary
Chapter 4: Functions, Switches, and Loops Structures
Functions
Looping structures
Switches
Combining the use of functions, switches, and loops
Best practices for functions, switches, and loops
Summary
Chapter 5: Regular Expressions
Getting started with regular expressions
Regular expression grouping constructs and ranges
Regular expression quantifiers
Regular expression anchors
Regular expressions examples
Summary
Chapter 6: Error and Exception Handling and Testing Code
Error and exception handling – parameters
Error and exception handling – Try/Catch
Error and exception handling – legacy exception handling
Methodologies for testing code
Summary
Chapter 7: Session-based Remote Management
Utilizing CIM sessions
Summary
Chapter 8: Managing Files, Folders, and Registry Items
Registry provider
Creating files, folders, and registry items with PowerShell
Adding named values to registry keys
Verifying files, folders, and registry items
Copying and moving files and folders
Renaming files, folders, registry keys, and named values
Deleting files, folders, registry keys, and named values
Summary
Chapter 9: File, Folder, and Registry Attributes, ACLs, and Properties
Retrieving attributes and properties
Viewing file and folder extended attributes
Setting the mode and extended file and folder attributes
Managing file, folder, and registry permissions
Summary
Chapter 10: Windows Management Instrumentation
WMI structure
Using WMI objects
Searching for WMI classes
Creating, modifying, and removing WMI property instances
Invoking WMI class methods
Summary
Chapter 11: XML Manipulation
XML file structure
Summary
Chapter 12: Managing Microsoft Systems with PowerShell
Managing local users and groups
Managing Windows services
Managing Windows processes
Installing Windows features and roles
Summary
Chapter 13: Automation of the Environment
Invoking programs for automation
Using desired state configuration
Detecting and restoring drifting configurations
Summary
Chapter 14: Script Creation Best Practices and Conclusion
Best practices for script management
# commenting headers
Best practices for script creation
Best practices for software automation
Summary

Book Details

ISBN 139781782173557
Paperback282 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

PowerShell 3.0 Advanced Administration Handbook Book Cover
PowerShell 3.0 Advanced Administration Handbook
$ 29.99
$ 21.00
Network Analysis using Wireshark Cookbook Book Cover
Network Analysis using Wireshark Cookbook
$ 29.99
$ 6.00
Mastering Windows Server 2016 Book Cover
Mastering Windows Server 2016
$ 47.99
$ 33.60
Linux Shell Scripting Cookbook, Second Edition Book Cover
Linux Shell Scripting Cookbook, Second Edition
$ 26.99
$ 5.40
C# 6 and .NET Core 1.0: Modern Cross-Platform Development Book Cover
C# 6 and .NET Core 1.0: Modern Cross-Platform Development
$ 39.99
$ 28.00
Learning Linux Shell Scripting Book Cover
Learning Linux Shell Scripting
$ 39.99
$ 28.00