PowerShell Splatting: Pass Parameters Cleanly
Splatting passes parameter collections to commands using @ notation. Learn to clean up long command lines and build dynamic parameter sets.
Commands Tips
Splatting passes parameter collections to commands using @ notation. Learn to clean up long command lines and build dynamic parameter sets.
Comment-based help makes your functions discoverable with Get-Help. Learn the correct syntax for synopsis, parameters, and example sections.
Dot-sourcing runs a script in the current scope so its functions stay available. Learn when to use it, how it differs from calling a script, and pitfalls.
Script blocks are reusable code objects in PowerShell. Learn to create, invoke, pass as arguments, and use them with Invoke-Command and ForEach-Object.
Advanced function parameters make PowerShell scripts user-proof. Learn Mandatory, ValidateSet, parameter sets, and pipeline input with examples.
Save any PowerShell output to a file with Out-File, Export-Csv, or redirection. Learn encoding, append mode, and when each method is best.
PowerShell has two ways to iterate: the foreach statement and ForEach-Object. Learn the real differences in performance, streaming, and pipeline use.
Group-Object groups pipeline objects by any property and counts each group. Learn to build frequency reports and analyze data patterns.
Measure-Object aggregates pipeline data with sum, average, min, max, and count. Learn to use it for disk reports, word counts, and number stats.
Enums enforce valid values in PowerShell scripts. Learn to use built-in .NET enums, define custom enums, and validate parameters with them.