# PowerShell

> PowerShell scripting resources for Microsoft 365 and Azure automation. Covers PnP.PowerShell, Microsoft.Graph module, Az module, Oh My Posh customization, and script analysis tools.

Source: https://ali.id.au/practices/running/powershell/ (last edited 2026-10-12)

## Official resources

* [PowerShell documentation](https://learn.microsoft.com/powershell/)
* [PowerShell Gallery](https://www.powershellgallery.com/)
* [What's new in PowerShell 7](https://learn.microsoft.com/powershell/scripting/whats-new/overview)

## Getting started

Tip: use the built-in [aliases](https://learn.microsoft.com/powershell/scripting/learn/shell/using-aliases?view=powershell-7.5) like `ls`, `cat`, `cd`, `man` - they're similar in Windows/Linux, which makes it easier to switch context.

* [PowerShell 101](https://learn.microsoft.com/powershell/scripting/learn/ps101/00-introduction)
* [Hanselman being awesome (50 min YouTube)](https://www.youtube.com/watch?v=VT2L1SXFq9U) + [blog post](https://www.hanselman.com/blog/my-ultimate-powershell-prompt-with-oh-my-posh-and-the-windows-terminal)
* [ctrl + space](https://www.youtube.com/watch?v=eo8h7AFAV1Y&t=75s) is your friend. Use wildcards too :)
* [Winget](https://www.youtube.com/shorts/EzYy-oPEBCY) + [My winget installs](/platforms/cloud-it/windows-quick-install/)

## Key modules for M365 and Azure

* [Microsoft.Graph](https://learn.microsoft.com/powershell/microsoftgraph/) - unified M365 management
* [PnP.PowerShell](https://pnp.github.io/powershell/) - SharePoint/M365
* [CLI for Microsoft 365](https://pnp.github.io/cli-microsoft365/) - cross-platform M365 CLI
* [Az module](https://learn.microsoft.com/powershell/azure/) - Azure management
* [ExchangeOnlineManagement](https://learn.microsoft.com/powershell/exchange/exchange-online-powershell)
* [MicrosoftTeams](https://learn.microsoft.com/microsoftteams/teams-powershell-overview)
* [Powershell Runbook for Azure Automation](https://learn.microsoft.com/azure/automation/automation-runbook-types) / [YouTube](https://www.youtube.com/watch?v=zmbDMuV9vTM)

## Tools

* [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) - linting
* [VS Code PowerShell extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell)
* [Oh My Posh](https://ohmyposh.dev/) - prompt theming
* [Awesome PowerShell](https://github.com/janikvonrotz/awesome-powershell)
* [Awesome CSV](https://github.com/secretGeek/AwesomeCSV)
* [xan csv](https://github.com/medialab/xan) amazing CSV tool
* [yq](https://github.com/mikefarah/yq) - query YAML/JSON/CSV/TOML in the command line, nicer version of jq

## Community resources

* [Chris Titus Tech](https://www.youtube.com/playlist?list=PLc7fktTRMBoyqGAg5UDdMle6ToDfhZXhd) - PowerShell tips and tricks
* [Adam the Automator](https://adamtheautomator.com/powershell-tutorial)
* [PowerShell.org](https://powershell.org/)
* [PowerShell subreddit](https://www.reddit.com/r/PowerShell/)
* [PowerShell Discord](https://aka.ms/psdiscord)
* [PnP PowerShell samples](https://pnp.github.io/script-samples/)

See also: [Admins + IT pros](/platforms/m365-sharepoint/it-admins/) for Microsoft 365 admin tools.

