FIND YOUR NEXT FEW LINES

Results for “portable paths”

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

320 snippets foundClear filters
PowerShellHashtables & object records

Convert an object’s properties into a hashtable

PowerShell: Enumerate PSObject.Properties when the set of property names is known only at runtime.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Convert between hexadecimal text and bytes

PowerShell: Use the .NET hexadecimal helpers instead of parsing byte pairs manually.

PowerShell✓ Tested
PowerShellDates & numeric validation

Convert Unix seconds into an aware UTC timestamp

PowerShell: DateTimeOffset.FromUnixTimeSeconds creates a value with an explicit UTC offset.

PowerShell✓ Tested
PowerShellFile operations & integrity

Copy a file to a chosen destination

PowerShell: LiteralPath prevents wildcard characters in the source filename from being interpreted.

PowerShell✓ Tested
PowerShellArray operations

Count a result even when it is empty or has one item

PowerShell: Wrap pipeline results in an array subexpression for consistent Count behavior.

PowerShell✓ Tested
PowerShellGetting Started

Count array elements

PowerShell: Count array elements using PowerShell 7.

PowerShell✓ Tested
PowerShellDates & numeric validation

Count days between calendar dates

PowerShell: Parse an unambiguous format before subtracting date values.

PowerShell✓ Tested
PowerShellCollections & objects

Count items by group

Group repeated values and report each count.

Group-Object✓ Tested
PowerShellFiles & paths

Create a directory if needed

Ensure a directory exists before writing output.

New-Item✓ Tested
PowerShellGetting Started

Create an array of text values

PowerShell: Create an array of text values using PowerShell 7.

PowerShell✓ Tested
PowerShellGetting Started

Create an object with named properties

PowerShell: Create an object with named properties using PowerShell 7.

PowerShell✓ Tested
PowerShellGetting Started

Define a function with a parameter

PowerShell: Define a function with a parameter using PowerShell 7.

PowerShell✓ Tested