FIND YOUR NEXT FEW LINES

Results for “power”

Small, practical examples. Search by task or narrow things down below.

128 snippets foundClear filters
PowerShellGetting Started

Split simple delimited text

PowerShell: Split simple delimited text using PowerShell 7.

PowerShell✓ Tested
PowerShellStrings & literal text

Split text on a simple delimiter

PowerShell: The split operator uses a regular expression; this delimiter has no special regex meaning.

PowerShell✓ Tested
PowerShellArray operations

Test whether an array contains a value

PowerShell: The contains operator compares complete items rather than matching substrings.

PowerShell✓ Tested
PowerShellGetting Started

Transform each pipeline value

PowerShell: Transform each pipeline value using PowerShell 7.

PowerShell✓ Tested
PowerShellStrings & literal text

Trim whitespace around a string

PowerShell: The Trim method removes surrounding whitespace while preserving the middle of the string.

PowerShell✓ Tested
PowerShellGetting Started

Use a counted loop

PowerShell: Use a counted loop using PowerShell 7.

PowerShell✓ Tested
PowerShellHashtables & object records

Use a fallback for a missing hashtable entry

PowerShell: Test the key explicitly so legitimate false or zero values are preserved.

PowerShell✓ Tested
PowerShellStrings & literal text

Use a literal value in a regular expression

PowerShell: Regex.Escape prevents a literal dot or other metacharacter from changing the match.

PowerShell✓ Tested
PowerShellStrings & literal text

Write a multiline string without expanding variables

PowerShell: A single-quoted here-string preserves dollar signs literally.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Write object records to a CSV file

PowerShell: Export-Csv uses property names as headers and quotes values when needed.

PowerShell✓ Tested
PowerShellFiles & paths

Build a portable file path

Combine directory and filename using the platform separator.

Join-Path✓ Tested
PowerShellFunctions & control

Choose an action with switch

Map a small command value to a result.

switch✓ Tested