Complete Guide to Windows PowerShell and PowerShell 7+ for System Administration, Automation, and Enterprise Scripting
Introduction: The PowerShell Ecosystem
- Who Should Use This Book
- How This Book Is Organized
- How to Use This Book
- Conventions Used in This Book
- Prerequisites
Chapter 1: PowerShell Foundations and Architecture
- What PowerShell Is and Isn’t
- The Object-Oriented Shell
- PowerShell Hosts and Runspaces
- The Execution Model
- Installation and Setup
Chapter 2: The Language Core
- Variables and Scope
- Data Types and Type Accelerators
- Operators
- Common Parameters Reference
- Summary of Common Parameters
- Language Keywords
- Expressions and Subexpressions
Chapter 3: The Pipeline and Objects
- How the Pipeline Works
- Working with Objects
- Custom Objects
- Pipeline Streams
- Advanced Pipeline Patterns
Chapter 4: Formatting System and Output Control
- The Formatting Pipeline
- Default Formatting Rules
- Format-Table
- Format-List
- Format-Wide
- Format-Custom
- Format-Hex
- Format.ps1xml Files
- Creating Custom Format Files
- Named Views and the View Parameter
- Type Extensions for Formatting
- Formatting and Export Operations
- Formatting Debugging
- Formatting Best Practices
Chapter 5: Cmdlets and Commands Reference (Core)
- Quick Navigation
- Session Management Cmdlets
- Variable and Preference Cmdlets
- Object Manipulation Cmdlets
- Input/Output and File Cmdlets
- Date/Time Cmdlets
- Microsoft.PowerShell.Core Module - Complete Reference
- Microsoft.PowerShell.Management Module - Complete Reference
- Microsoft.PowerShell.Utility Module - Complete Reference
- Microsoft.PowerShell.Security Module - Complete Reference
- Microsoft.PowerShell.Diagnostics Module Reference
- CimCmdlets Module Reference
Chapter 6: Providers and Drives
- Provider Architecture
- FileSystem Provider
- Registry Provider (Windows only)
- Environment Provider
- Function Provider
- Variable Provider
- Certificate Provider (Windows only)
- Other Built-in Providers
- Provider Best Practices
Chapter 7: Error Handling and Debugging
- Error Types and Categories
- Try/Catch/Finally
- Error Preference Variables
- The $Error Automatic Variable
- Debugging Techniques
- Advanced Error Patterns
Chapter 8: Functions and Scripting Fundamentals
- Basic Functions
- Advanced Functions
- Parameter Attributes
- Parameter Validation
- Pipeline Support in Functions
- Filters
- Script Conventions and Best Practices
Chapter 9: Modules and Code Organization
- Module Fundamentals
- Creating Modules
- Module Management Cmdlets
- PowerShell Gallery
- Module Best Practices
Chapter 10: Classes and Object-Oriented Scripting
- Class Syntax and Basics
- Inheritance and Modifiers
- Enums in PowerShell
- When to Use Classes vs PSCustomObject
- Integration with .NET Classes
- Using Classes in Modules
Chapter 11: Remoting and Cross-Machine Administration
- Remoting Architecture
- Configuring Remoting
- Session-Based Remoting
- Ad-Hoc Remoting
- Advanced Remoting Scenarios
- PowerShell 7+ Remoting Changes
Chapter 12: Background Jobs and Parallel Execution
- Job Cmdlets
- Throttle and Parallelism
- PowerShell 7+ Parallel Processing
- Runspaces: Advanced Parallel Execution
- Workflow Background Execution (Historical)
Chapter 13: Desired State Configuration (DSC)
- DSC Architecture
- Built-in DSC Resources
- Writing Custom DSC Resources
- DSC in Practice
- DSC Compliance and Reporting
- DSC Pull Servers
Chapter 14: Event Logs, Performance Counters, and Monitoring
- Event Log Cmdlets
- Performance Counters
- Diagnostic Tools
- Structured Logging for Production Scripts
Chapter 15: Active Directory and Identity Management
- The ActiveDirectory Module
- User Management
- Group Management
- Computer Management
- Organizational Units and Structure
- Advanced AD Scenarios
Chapter 16: Networking Administration
- The NetTCPIP Module
- IP Configuration
- DNS Management
- Routing and Interfaces
- Firewall Management (NetSecurity Module)
- Network Diagnostics
- Advanced Network Configuration
- Network Monitoring and Troubleshooting
Chapter 17: Storage and Disk Management
- Disk Management Cmdlets
- Volume Management
- Partition Management
- Virtual Disk Management (VHD/VHDX)
- Storage Spaces
- Storage Monitoring and Health
- Practical Storage Automation Scenarios
Chapter 18: Hyper-V Virtualization Management
- The Hyper-V Module
- Virtual Machine Lifecycle Management
- Virtual Machine Configuration
- Virtual Machine Checkpoints (Snapshots)
- Virtual Switches and Networking
- Virtual Machine Storage
- Virtual Machine Export and Import
- Virtual Machine Replication
- Hyper-V Host Management
- Practical Automation Scenarios
Chapter 19: Scheduled Tasks and Automation Scheduling
- The ScheduledTasks Module
- Creating Tasks
- Task Triggers
- Task Actions
- Task Principals
- Task Settings
- Managing Tasks
- Event-Based Triggers (Advanced)
- Best Practices for Scheduled PowerShell Tasks
Chapter 20: Certificates and Security Administration
- Certificate Provider
- Execution Policies
Chapter 21: Cloud Administration — Azure and AWS
- Azure Administration with the Az Module
- Azure Resource Management
- Azure Virtual Machines (Az.Compute)
- Azure Storage (Az.Storage)
- Azure Networking (Az.Network)
- Azure Automation Scenarios
- AWS Administration with AWS Tools for PowerShell
- Amazon EC2 (AWS.Tools.EC2)
- Amazon S3 (AWS.Tools.S3)
- Amazon RDS (AWS.Tools.RDS)
- Cross-Cloud Automation Patterns
Chapter 22: WMI, CIM, and System Management Infrastructure
- WMI vs CIM
- CIM Cmdlets
- Common WMI/CIM Classes
- CIM Sessions and Remote Management
- Practical Inventory Script
Chapter 23: Data Formats and External Integration
- JSON Processing
- XML Processing
- CSV and Tabular Data
- REST API Integration
- Database Access
Chapter 24: Profiles and Environment Configuration
- Profile Files
- What Belongs in a Profile
- The Prompt Function
- Profile Best Practices
Chapter 25: Script Signing, Security, and Deployment
- Code Signing Fundamentals
- Creating and Using Certificates
- Signing Scripts
- Verifying Signatures
- Enterprise Deployment Patterns
Chapter 26: Testing and Maintainability
- Pester Testing Framework
- PSScriptAnalyzer
- Version Control Integration
- Documentation Standards
Chapter 27: Performance Optimization and Troubleshooting
- Measuring Performance
- Common Performance Pitfalls
- Memory Management
- Troubleshooting Slow Scripts
Chapter 28: Cross-Platform PowerShell (PowerShell 7+)
- PowerShell 7 Architecture
- Compatibility Layer
- Breaking Changes and Differences
- Platform-Specific Cmdlets
- SSH Remoting in PowerShell 7
- Linux and macOS Administration
- Best Practices for Cross-Platform Scripts
Conclusion: PowerShell in Modern IT Automation
- PowerShell’s Role in the Automation Landscape
- The Path Forward
- How to Continue Learning
References
Index
- A
- B
- C
- D
- E
- F
- G
- H
- I
- J
- K
- L
- M
- N
- O
- P
- Q
- R
- S
- T
- U
- V
- W
- Z