FIND YOUR NEXT FEW LINES

Results for “PowerShell”

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

125 snippets foundClear filters
PowerShellStructured formats & encodings

Encode and decode UTF-8 text with Base64

PowerShell: Convert the string to bytes explicitly before Base64 encoding.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Enforce a numeric range at a function boundary

PowerShell: ValidateRange performs argument validation before work begins.

PowerShell✓ Tested
PowerShellHashtables & object records

Enumerate hashtable entries in a stable order

PowerShell: Sort entries by key when predictable output matters.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Escape a single URL parameter value

PowerShell: EscapeDataString encodes one value without treating it as a complete URL.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Escape plain text before placing it in HTML

PowerShell: HtmlEncode converts HTML delimiters to entities in ordinary text contexts.

PowerShell✓ Tested
PowerShellStrings & literal text

Extract a known substring

PowerShell: Substring uses a zero-based starting index and a character count.

PowerShell✓ Tested
PowerShellGetting Started

Filter pipeline values

PowerShell: Filter pipeline values using PowerShell 7.

PowerShell✓ Tested
PowerShellHashtables & object records

Find differences between two collections

PowerShell: Compare-Object marks reference-only values with a left arrow and difference-only values with a right arrow.

PowerShell✓ Tested
PowerShellFile operations & integrity

Find matching files recursively

PowerShell: Select files explicitly and sort their names for predictable presentation.

PowerShell✓ Tested
PowerShellArray operations

Find the index of an array item

PowerShell: Array.IndexOf returns -1 when the requested item is absent.

PowerShell✓ Tested
PowerShellDates & numeric validation

Find the number of days in a month

PowerShell: DaysInMonth handles leap-year February correctly.

PowerShell✓ Tested
PowerShellDates & numeric validation

Format a bounded duration as hours minutes and seconds

PowerShell: TimeSpan can format duration components with escaped separators.

PowerShell✓ Tested