- Setting up a reliable scripting environment
- Designing functions and scripts
- Effective pipeline usage
- Scripting and security
- Dealing with errors and bugs
- Source control with git
- Sharing and publishing scripts
- Professional-grade scripting practices
The PowerShell language lets you write scripts to control nearly every aspect of Windows. Just master a few straightforward scripting skills, and you'll save yourself from hours of tedious tasks. This revised second edition is fully updated to PowerShell's latest version, including hands-on examples that perfectly demonstrate modern PowerShell's cross-platform applications. Purchase of the print book includes a free eBook in PDF and ePub formats from Manning Publications. About the technology You can write PowerShell scripts to automate nearly any admin task on Windows, Linux, and macOS. This book shows you how! In just 27 short lessons you can complete on your lunch break, you'll learn to create, organize, test, and share scripts and tools that will save you hours of time in your daily work. About the book Learn PowerShell Scripting in a Month of Lunches, Second Edition is a hands-on introduction to PowerShell automation and toolbuilding. Updated for the latest version of PowerShell, this thoroughly revised bestseller teaches you how to write efficient scripts, find and squash bugs, and organize your tools into libraries. Along the way, you'll even pick up tips for securing and managing Linux and macOS systems. What's inside
- Setting up a reliable scripting environment
- Designing functions and scripts
- Effective pipeline usage
- Sharing and publishing scripts
1 Before you begin
2 Setting up your scripting environment
3 WWPD: What would PowerShell do?
4 Review: Parameter binding and the PowerShell pipeline
5 Scripting language: A crash course
6 The many forms of scripting (and which to choose)
7 Scripts and security
PART 2
8 Always design first
9 Avoiding bugs: Start with a command
10 Building a basic function and script module
11 Getting started with advanced functions
12 Objects: The best kind of output
13 Using all the streams
14 Simple help: Making a comment
15 Errors and how to deal with them
16 Filling out a manifest
PART 3
17 Changing your brain when it comes to scripting
18 Professional-grade scripting
19 An introduction to source control with Git
20 Pestering your script
21 Signing your script
22 Publishing your script
PART 4
23 Squashing bugs
24 Enhancing script output presentation
25 Wrapping up the .NET Framework
26 Storing data--not in Excel!
27 Never the end