Master Windows automation and system administration with PowerShell
Welcome to your comprehensive PowerShell learning journey! This repository contains everything you need to go from beginner to advanced PowerShell scripting and automation.
- Functions & Modules
- Error Handling
- File System Operations
- Working with Arrays & Hash Tables
- Control Flow (If, Switch, Loops)
- PowerShell Remoting
- Advanced Functions & Script Blocks
- Working with .NET Classes
- DSC (Desired State Configuration)
- Advanced Scripting Techniques
- Security & Best Practices
- PowerShell for DevOps
- Azure & Cloud Automation
PowerShell comes pre-installed on Windows 10/11 and Windows Server 2016+.
For the latest version (PowerShell 7+):
winget install --id Microsoft.Powershell --source wingetGet-Process | Where-Object {$_.CPU -gt 100}- Week 1-2: Master the fundamentals (Cmdlets, Variables, Objects)
- Week 3-4: Build working scripts (Functions, Error Handling, File Operations)
- Week 5-6: Advanced topics (Remoting, DSC, .NET Integration)
- Week 7-8: Real-world projects and automation
- Object-Based: Unlike traditional shells that work with text, PowerShell works with .NET objects
- Verb-Noun Naming: Cmdlets follow a consistent
Verb-Nounpattern (e.g.,Get-Process,Set-Item) - Pipeline Power: Chain commands together to create powerful one-liners
- Discoverable: Use
Get-Command,Get-Help, andGet-Memberto explore
Get-Command # Find available cmdlets
Get-Help # Get help for any cmdlet
Get-Member # Explore object properties and methods
Where-Object # Filter results
Select-Object # Choose specific properties
ForEach-Object # Loop through items- "Learn PowerShell in a Month of Lunches" by Don Jones
- "PowerShell for Sysadmins" by Adam Bertram
- "Windows PowerShell in Action" by Bruce Payette
- Always use approved verbs (
Get-Verbto see the list) - Write comment-based help for your functions
- Use parameter validation to make scripts robust
- Implement proper error handling with Try-Catch-Finally
- Follow naming conventions (PascalCase for functions, camelCase for variables)
- Use meaningful variable names instead of abbreviations
- Test scripts in non-production environments first
- Version control your scripts with Git
- PowerShell Extension - Official Microsoft extension
- PowerShell Preview - Latest features and improvements
- PSScriptAnalyzer - Code quality and style checker
# Azure modules
Install-Module -Name Az -AllowClobber -Scope CurrentUser
# Active Directory
Install-Module -Name ActiveDirectory
# Pester (Testing framework)
Install-Module -Name Pester -ForceContributions are welcome! Feel free to:
- Add new examples
- Improve documentation
- Report issues
- Suggest improvements
This repository is for educational purposes. Feel free to use and modify the scripts for your needs.
Ready to dive in? Start with:
Happy Scripting! 🚀💪