FIND YOUR NEXT FEW LINES

Results for “Test-Path”

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

1055 snippets foundClear filters
PowerShellFile operations & integrity

Read a file size in bytes

PowerShell: The Length property of a file item reports its logical byte size.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Read a tab-separated table

PowerShell: ConvertFrom-Csv accepts an explicit delimiter instead of requiring comma-separated input.

PowerShell✓ Tested
PythonFiles & paths

Read a text file

Open a UTF-8 text file and read its contents. A context manager closes the file automatically, even if reading fails.

file✓ Tested
JavaFiles & paths

Read a UTF-8 file

Read a small UTF-8 file into a Java string.

Java✓ Tested
PowerShellGetting Started

Read a value from a hashtable

PowerShell: Read a value from a hashtable using PowerShell 7.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Read a value from a trusted XML document

PowerShell: The XML adapter exposes a small document’s elements and attributes through named properties.

PowerShell✓ Tested
PowerShellFiles & paths

Read a whole text file

Load text as one string instead of one item per line.

Get-Content✓ Tested
PowerShellStructured formats & encodings

Read JSON into a hashtable

PowerShell: AsHashtable produces dictionary-style results for keys that are data rather than fixed property names.

PowerShell✓ Tested
PowerShellCommands & execution context

Read named fields from a successful regex match

PowerShell: The Matches table is updated after a successful scalar match operation.

PowerShell✓ Tested
PowerShellText & data

Read rows from CSV text

Parse CSV into objects with named properties.

CSV✓ Tested
GitInspecting the working tree

Read the exact version currently staged

Git: The colon path syntax reads a blob from the index rather than from HEAD or the working file.

Git✓ Tested
PowerShellCommands & execution context

Read the kind of command being invoked

PowerShell: CommandType distinguishes cmdlets from functions, aliases, and external applications.

PowerShell✓ Tested