Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering PowerShell Scripting

You're reading from   Mastering PowerShell Scripting Automate and manage your environment using PowerShell 7.1

Arrow left icon
Product type Paperback
Published in Jun 2021
Publisher Packt
ISBN-13 9781800206540
Length 788 pages
Edition 4th Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Chris Dent Chris Dent
Author Profile Icon Chris Dent
Chris Dent
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Preface 1. Introduction to PowerShell 2. Modules and Snap-Ins FREE CHAPTER 3. Working with Objects in PowerShell 4. Operators 5. Variables, Arrays, and Hashtables 6. Conditional Statements and Loops 7. Working with .NET 8. Strings, Numbers, and Dates 9. Regular Expressions 10. Files, Folders, and the Registry 11. Windows Management Instrumentation 12. Working with HTML, XML, and JSON 13. Web Requests and Web Services 14. Remoting and Remote Management 15. Asynchronous Processing 16. Graphical User Interfaces 17. Scripts, Functions, and Script Blocks 18. Parameters, Validation, and Dynamic Parameters 19. Classes and Enumerations 20. Building Modules 21. Testing 22. Error Handling 23. Debugging and Troubleshooting 24. Other Books You May Enjoy
25. Index

What this book covers

Chapter 1, Introduction to PowerShell, introduces you to editors, the help system, command naming, and more.

Chapter 2, Modules and Snap-Ins, explores finding, installing, and using modules in PowerShell. Snap-ins are not part of PowerShell 7 but are briefly explored as a legacy feature of PowerShell 5.

Chapter 3, Working with Objects in PowerShell, looks at the concept of objects in PowerShell and the generic commands available for selecting, filtering, and manipulating values.

Chapter 4, Operators, explores the large variety of operators available in PowerShell.

Chapter 5, Variables, Arrays, and Hashtables are an important topic in PowerShell. The chapter explores the use of variables, as well as the capabilities of collections.

Chapter 6, Conditional Statements and Loops are the tools used to make decisions in scripts in PowerShell. This chapter explores keywords like If, and the different loop styles available.

Chapter 7, Working with .NET, is used to dive into .NET, which was used to create the PowerShell language and is available within PowerShell.

Chapter 8, Strings, Numbers, and Dates are a vital part of any scripting language, and PowerShell is no exception. This chapter explores the different techniques available for working with such values.

Chapter 9, Regular Expressions are an incredibly useful inclusion in PowerShell. You can use regular expressions to make short work of string parsing tasks. The chapter ends by walking through several practical parsing examples.

Chapter 10, File, Folders, and the Registry, explores the use of providers in PowerShell, most used to access the file system and, in Windows, the registry.

Chapter 11, Windows Management Instrumentation, explores WMI in PowerShell, a significant part of the Windows operating system since Windows NT.

Chapter 12, Working with HTML, XML, and JSON, looks at the PowerShell commands and .NET types that you can use to work with these different text-based formats.

Chapter 13, Web Requests and Web Services, explores basic web requests before diving into using PowerShell to work with REST APIs, using the API for GitHub as an example. Support for SOAP in PowerShell 7 is less complete than in PowerShell 5.1. SOAP is explored by way of a web service project via Visual Studio.

Chapter 14, Remoting and Remote Management, examines the configuration and use of PowerShell Remoting in both Windows and Linux.

Chapter 15, Asynchronous Processing, dives into the realm of background jobs in PowerShell before exploring .NET events in PowerShell. The chapter ends with a look at runspaces and runspace pools.

Chapter 16, Graphical User Interfaces, shows you how to implement responsive user interfaces in PowerShell.

Chapter 17, Scripts, Functions, and Script Blocks, explores the building blocks of larger scripts and modules. The chapter looks at how to define parameters, work in a pipeline, and manage output.

Chapter 18, Parameters, Validation, and Dynamic Parameters, looks at the many options available for defining parameters and validating input in PowerShell.

Chapter 19, Classes and Enumerations, shows off the capabilities of the class and enum keywords, which were introduced with PowerShell 5. The chapter includes an exploration of class inheritance and implementing .NET interfaces. This chapter includes a brief look at writing class-based DSC resources.

Chapter 20, Building Modules, explores the key concepts of creating a module in PowerShell using PowerShell code. The chapter shows off some of the common approaches available to module authors.

Chapter 21, Testing, is used to explore static analysis using PSScriptAnalyzer as well as acceptance and unit testing using the Pester framework.

Chapter 22, Error Handling, looks at the complex topic of handling errors in PowerShell, including an exploration of both terminating and non-terminating errors.

Chapter 23, Debugging and Troubleshooting, uses the built-in debugger in PowerShell and Visual Studio to delve into some of the common problems encountered when debugging scripts.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime