Leanpub Header

Skip to main content

PowerShell: The Complete Reference

Windows PowerShell and PowerShell 7+ for System Administration, Automation, and Enterprise Scripting

This book is 100% completeLast updated on 2026-07-22

Whether you're learning PowerShell or managing enterprise environments, this book is a practical reference for Windows PowerShell 5.1 and PowerShell 7+. It covers core concepts, scripting, automation and administration with clear examples based on official Microsoft documentation.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
469
Pages
About

About

About the Book

This book is a comprehensive technical reference for Microsoft PowerShell, covering everything from fundamental concepts to advanced enterprise automation. It documents the architecture of PowerShell including the pipeline, objects, providers, and modules; every built-in cmdlet in the core modules with complete syntax and parameters; language constructs including operators, keywords, variables, and classes; remoting, background jobs, Desired State Configuration (DSC), error handling, debugging, security, profiles, formatting, and performance optimization. It covers both Windows PowerShell 5.1 and cross-platform PowerShell 7+, with practical examples for file systems, processes, services, event logs, the registry, Active Directory, networking, storage, Hyper-V, scheduled tasks, certificates, WMI/CIM, REST APIs, JSON, XML, CSV, databases, cloud administration, and enterprise management. All technical content is based on official Microsoft documentation and current PowerShell behavior.

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 400 engineers and researchers from Ukraine, Belarus and Russia. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

Complete Guide to Windows PowerShell and PowerShell 7+ for System Administration, Automation, and Enterprise Scripting

Introduction: The PowerShell Ecosystem

  1. Who Should Use This Book
  2. How This Book Is Organized
  3. How to Use This Book
  4. Conventions Used in This Book
  5. Prerequisites

Chapter 1: PowerShell Foundations and Architecture

  1. What PowerShell Is and Isn’t
  2. The Object-Oriented Shell
  3. PowerShell Hosts and Runspaces
  4. The Execution Model
  5. Installation and Setup

Chapter 2: The Language Core

  1. Variables and Scope
  2. Data Types and Type Accelerators
  3. Operators
  4. Common Parameters Reference
  5. Summary of Common Parameters
  6. Language Keywords
  7. Expressions and Subexpressions

Chapter 3: The Pipeline and Objects

  1. How the Pipeline Works
  2. Working with Objects
  3. Custom Objects
  4. Pipeline Streams
  5. Advanced Pipeline Patterns

Chapter 4: Formatting System and Output Control

  1. The Formatting Pipeline
  2. Default Formatting Rules
  3. Format-Table
  4. Format-List
  5. Format-Wide
  6. Format-Custom
  7. Format-Hex
  8. Format.ps1xml Files
  9. Creating Custom Format Files
  10. Named Views and the View Parameter
  11. Type Extensions for Formatting
  12. Formatting and Export Operations
  13. Formatting Debugging
  14. Formatting Best Practices

Chapter 5: Cmdlets and Commands Reference (Core)

  1. Quick Navigation
  2. Session Management Cmdlets
  3. Variable and Preference Cmdlets
  4. Object Manipulation Cmdlets
  5. Input/Output and File Cmdlets
  6. Date/Time Cmdlets
  7. Microsoft.PowerShell.Core Module - Complete Reference
  8. Microsoft.PowerShell.Management Module - Complete Reference
  9. Microsoft.PowerShell.Utility Module - Complete Reference
  10. Microsoft.PowerShell.Security Module - Complete Reference
  11. Microsoft.PowerShell.Diagnostics Module Reference
  12. CimCmdlets Module Reference

Chapter 6: Providers and Drives

  1. Provider Architecture
  2. FileSystem Provider
  3. Registry Provider (Windows only)
  4. Environment Provider
  5. Function Provider
  6. Variable Provider
  7. Certificate Provider (Windows only)
  8. Other Built-in Providers
  9. Provider Best Practices

Chapter 7: Error Handling and Debugging

  1. Error Types and Categories
  2. Try/Catch/Finally
  3. Error Preference Variables
  4. The $Error Automatic Variable
  5. Debugging Techniques
  6. Advanced Error Patterns

Chapter 8: Functions and Scripting Fundamentals

  1. Basic Functions
  2. Advanced Functions
  3. Parameter Attributes
  4. Parameter Validation
  5. Pipeline Support in Functions
  6. Filters
  7. Script Conventions and Best Practices

Chapter 9: Modules and Code Organization

  1. Module Fundamentals
  2. Creating Modules
  3. Module Management Cmdlets
  4. PowerShell Gallery
  5. Module Best Practices

Chapter 10: Classes and Object-Oriented Scripting

  1. Class Syntax and Basics
  2. Inheritance and Modifiers
  3. Enums in PowerShell
  4. When to Use Classes vs PSCustomObject
  5. Integration with .NET Classes
  6. Using Classes in Modules

Chapter 11: Remoting and Cross-Machine Administration

  1. Remoting Architecture
  2. Configuring Remoting
  3. Session-Based Remoting
  4. Ad-Hoc Remoting
  5. Advanced Remoting Scenarios
  6. PowerShell 7+ Remoting Changes

Chapter 12: Background Jobs and Parallel Execution

  1. Job Cmdlets
  2. Throttle and Parallelism
  3. PowerShell 7+ Parallel Processing
  4. Runspaces: Advanced Parallel Execution
  5. Workflow Background Execution (Historical)

Chapter 13: Desired State Configuration (DSC)

  1. DSC Architecture
  2. Built-in DSC Resources
  3. Writing Custom DSC Resources
  4. DSC in Practice
  5. DSC Compliance and Reporting
  6. DSC Pull Servers

Chapter 14: Event Logs, Performance Counters, and Monitoring

  1. Event Log Cmdlets
  2. Performance Counters
  3. Diagnostic Tools
  4. Structured Logging for Production Scripts

Chapter 15: Active Directory and Identity Management

  1. The ActiveDirectory Module
  2. User Management
  3. Group Management
  4. Computer Management
  5. Organizational Units and Structure
  6. Advanced AD Scenarios

Chapter 16: Networking Administration

  1. The NetTCPIP Module
  2. IP Configuration
  3. DNS Management
  4. Routing and Interfaces
  5. Firewall Management (NetSecurity Module)
  6. Network Diagnostics
  7. Advanced Network Configuration
  8. Network Monitoring and Troubleshooting

Chapter 17: Storage and Disk Management

  1. Disk Management Cmdlets
  2. Volume Management
  3. Partition Management
  4. Virtual Disk Management (VHD/VHDX)
  5. Storage Spaces
  6. Storage Monitoring and Health
  7. Practical Storage Automation Scenarios

Chapter 18: Hyper-V Virtualization Management

  1. The Hyper-V Module
  2. Virtual Machine Lifecycle Management
  3. Virtual Machine Configuration
  4. Virtual Machine Checkpoints (Snapshots)
  5. Virtual Switches and Networking
  6. Virtual Machine Storage
  7. Virtual Machine Export and Import
  8. Virtual Machine Replication
  9. Hyper-V Host Management
  10. Practical Automation Scenarios

Chapter 19: Scheduled Tasks and Automation Scheduling

  1. The ScheduledTasks Module
  2. Creating Tasks
  3. Task Triggers
  4. Task Actions
  5. Task Principals
  6. Task Settings
  7. Managing Tasks
  8. Event-Based Triggers (Advanced)
  9. Best Practices for Scheduled PowerShell Tasks

Chapter 20: Certificates and Security Administration

  1. Certificate Provider
  2. Execution Policies

Chapter 21: Cloud Administration — Azure and AWS

  1. Azure Administration with the Az Module
  2. Azure Resource Management
  3. Azure Virtual Machines (Az.Compute)
  4. Azure Storage (Az.Storage)
  5. Azure Networking (Az.Network)
  6. Azure Automation Scenarios
  7. AWS Administration with AWS Tools for PowerShell
  8. Amazon EC2 (AWS.Tools.EC2)
  9. Amazon S3 (AWS.Tools.S3)
  10. Amazon RDS (AWS.Tools.RDS)
  11. Cross-Cloud Automation Patterns

Chapter 22: WMI, CIM, and System Management Infrastructure

  1. WMI vs CIM
  2. CIM Cmdlets
  3. Common WMI/CIM Classes
  4. CIM Sessions and Remote Management
  5. Practical Inventory Script

Chapter 23: Data Formats and External Integration

  1. JSON Processing
  2. XML Processing
  3. CSV and Tabular Data
  4. REST API Integration
  5. Database Access

Chapter 24: Profiles and Environment Configuration

  1. Profile Files
  2. What Belongs in a Profile
  3. The Prompt Function
  4. Profile Best Practices

Chapter 25: Script Signing, Security, and Deployment

  1. Code Signing Fundamentals
  2. Creating and Using Certificates
  3. Signing Scripts
  4. Verifying Signatures
  5. Enterprise Deployment Patterns

Chapter 26: Testing and Maintainability

  1. Pester Testing Framework
  2. PSScriptAnalyzer
  3. Version Control Integration
  4. Documentation Standards

Chapter 27: Performance Optimization and Troubleshooting

  1. Measuring Performance
  2. Common Performance Pitfalls
  3. Memory Management
  4. Troubleshooting Slow Scripts

Chapter 28: Cross-Platform PowerShell (PowerShell 7+)

  1. PowerShell 7 Architecture
  2. Compatibility Layer
  3. Breaking Changes and Differences
  4. Platform-Specific Cmdlets
  5. SSH Remoting in PowerShell 7
  6. Linux and macOS Administration
  7. Best Practices for Cross-Platform Scripts

Conclusion: PowerShell in Modern IT Automation

  1. PowerShell’s Role in the Automation Landscape
  2. The Path Forward
  3. How to Continue Learning

References

Index

  1. A
  2. B
  3. C
  4. D
  5. E
  6. F
  7. G
  8. H
  9. I
  10. J
  11. K
  12. L
  13. M
  14. N
  15. O
  16. P
  17. Q
  18. R
  19. S
  20. T
  21. U
  22. V
  23. W
  24. Z

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub