Getting to Know and Setting Up PowerShell 7
- Windows PowerShell 5.1 vs. PowerShell 7: .NET foundation, side-by-side installation, pwsh.exe, use on Windows, Linux and macOS
- Release model with LTS and Stable versions, installation and updates, on Windows also via Microsoft Update
- Working environment: console, Visual Studio Code with the PowerShell extension, profiles
- Finding help and commands: Update-Help, Get-Help, Get-Command, Get-Member, aliases
Working with Commands and the Pipeline
- Cmdlet syntax, parameters and splatting
- Selecting, sorting, grouping and measuring objects in the pipeline, filtering with Where-Object and processing with ForEach-Object
- Understanding ByValue and ByPropertyName parameter binding and using it deliberately
- Formatting and redirecting output, exporting, importing and converting data as CSV, JSON and XML
Providers, Files and System Information
- PSProvider and PSDrives: file system, registry, certificate store, environment variables
- Managing files and folders, evaluating text files, character encoding (UTF-8 without BOM as the default)
- Querying and changing system information with the CIM cmdlets – the WMI v1 cmdlets no longer exist in PowerShell 7
- Evaluating services, processes and event logs with Get-WinEvent
Modules and Packages
- Finding, loading and managing modules, understanding PSModulePath
- Installing and updating modules from the PowerShell Gallery with Microsoft.PowerShell.PSResourceGet
- Continuing to use Windows PowerShell modules via Windows PowerShell compatibility
From Command to Script
- Variables, data types, arrays, hash tables and PSCustomObject
- Operators, including those introduced with PowerShell 7: the ternary operator, pipeline chain operators, null coalescing operators and null conditional operators
- Control structures: if, switch, foreach, while
- Execution policies, script signing and the secure handling of credentials
Functions, Error Handling and Your Own Modules
- Functions with parameters, basic parameter validation and comment-based help
- Error handling with try, catch and finally, ErrorActionPreference, the ConciseView error view and Get-Error
- Providing your own functions as a script module
Remote Management
- Setting up PowerShell remoting over WinRM and over SSH
- Running commands on multiple computers with Invoke-Command, using persistent sessions (PSSession)
- Remotely managing servers without a graphical interface, such as Server Core
Jobs and Parallelisation
- Starting and evaluating background jobs and thread jobs
- Speeding up processing with ForEach-Object -Parallel
- Running scripts on a schedule via Windows Task Scheduler
- Final exercise: capturing an inventory of multiple servers by script and exporting it as a report