FIND YOUR NEXT FEW LINES

Results for “path”

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

233 snippets foundClear filters
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
PowerShellText & data

Format a date without locale ambiguity

Parse an ISO date and format it consistently.

date✓ Tested
PowerShellStructured formats & encodings

Handle a malformed JSON document

PowerShell: ConvertFrom-Json reports a terminating conversion error under the selected error preference.

PowerShell✓ Tested
CFile positioning & lifecycle

Handle a missing file without treating it as an empty file

C: Inspect errno after a failed fopen to distinguish the documented missing-path condition.

C✓ Tested
PowerShellFunctions & control

Handle a terminating error

Catch conversion failures and produce a clear fallback.

try catch✓ Tested
PowerShellGetting Started

Handle an expected terminating error

PowerShell: Handle an expected terminating error using PowerShell 7.

PowerShell✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Identify whether a name resolves to a builtin

Bash Scripts: type -t reports the command kind without printing a machine-specific path.

Bash Scripts✓ Tested
PowerShellGetting Started

Insert a variable into a string

PowerShell: Insert a variable into a string using PowerShell 7.

PowerShell✓ Tested
PowerShellStrings & literal text

Insert values into a multiline template

PowerShell: A double-quoted here-string expands variable references.

PowerShell✓ Tested
PowerShellCommands & execution context

Inspect a URI through typed properties

PowerShell: The Uri class separates URL components without manual string splitting.

PowerShell✓ Tested