FIND YOUR NEXT FEW LINES

Results for “power”

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

128 snippets foundClear filters
PowerShellStrings & literal text

Pad a label with leading zeroes

PowerShell: Use a numeric format specifier to control the displayed width.

PowerShell✓ Tested
PowerShellArray operations

Pair corresponding values from two arrays

PowerShell: Check lengths before indexing to reject mismatched input collections.

PowerShell✓ Tested
PowerShellDates & numeric validation

Parse a hexadecimal integer

PowerShell: Convert.ToInt32 accepts an explicit base for a validated hexadecimal string.

PowerShell✓ Tested
PowerShellDates & numeric validation

Parse an integer without throwing on invalid input

PowerShell: TryParse reports conversion success separately from its output value.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Pass a block of behavior as an argument

PowerShell: Invoke a scriptblock with the call operator and an explicit input value.

PowerShell✓ Tested
PowerShellCommands & execution context

Pass an environment value to a child process

PowerShell: The process environment is inherited by a launched child PowerShell process.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Preserve a failure after local cleanup

PowerShell: A bare throw inside catch rethrows the current exception.

PowerShell✓ Tested
PowerShellHashtables & object records

Preserve key insertion order

PowerShell: An ordered dictionary enumerates keys in the order they were inserted.

PowerShell✓ Tested
PowerShellGetting Started

Process every array element

PowerShell: Process every array element using PowerShell 7.

PowerShell✓ Tested
PowerShellGetting Started

Read a collection element

PowerShell: Read a collection element using PowerShell 7.

PowerShell✓ Tested
PowerShellFile operations & integrity

Read a file lazily through the .NET line iterator

PowerShell: ReadLines avoids creating one string containing the entire file.

PowerShell✓ Tested
PowerShellFile operations & integrity

Read a file size in bytes

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

PowerShell✓ Tested