The snippet library.
Small, practical examples. Search by task or narrow things down below.
Join an array into text
PowerShell: Join an array into text using PowerShell 7.
PowerShell✓ Tested
Keep a dollar sign literal
PowerShell: Keep a dollar sign literal using PowerShell 7.
PowerShell✓ Tested
Process every array element
PowerShell: Process every array element using PowerShell 7.
PowerShell✓ Tested
Read a collection element
PowerShell: Read a collection element using PowerShell 7.
PowerShell✓ Tested
Read a value from a hashtable
PowerShell: Read a value from a hashtable using PowerShell 7.
PowerShell✓ Tested
Repeat while a condition holds
PowerShell: Repeat while a condition holds using PowerShell 7.
PowerShell✓ Tested
Replace a literal word in text
PowerShell: Replace a literal word in text using PowerShell 7.
PowerShell✓ Tested
Run a first PowerShell statement
PowerShell: Run a first PowerShell statement using PowerShell 7.
PowerShell✓ Tested
Select the first pipeline values
PowerShell: Select the first pipeline values using PowerShell 7.
PowerShell✓ Tested
Sort a sequence of numbers
PowerShell: Sort a sequence of numbers using PowerShell 7.
PowerShell✓ Tested
Split simple delimited text
PowerShell: Split simple delimited text using PowerShell 7.
PowerShell✓ Tested
Transform each pipeline value
PowerShell: Transform each pipeline value using PowerShell 7.
PowerShell✓ Tested