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

Check a string prefix using ordinal comparison

PowerShell: Supply an explicit comparison rule for protocol identifiers.

PowerShell✓ Tested
PowerShellStrings & literal text

Check a suffix without case sensitivity

PowerShell: Use an ordinal case-insensitive comparison for a known filename extension.

PowerShell✓ Tested
PowerShellCommands & execution context

Check an external process exit status explicitly

PowerShell: LASTEXITCODE reports a native child exit code independently of ordinary PowerShell cmdlet errors.

PowerShell✓ Tested
PowerShellHashtables & object records

Check for a hashtable key before reading it

PowerShell: ContainsKey distinguishes a missing key from a key whose value happens to be null.

PowerShell✓ Tested
PowerShellCommands & execution context

Check whether a command can be resolved

PowerShell: Get-Command with a local error override supports an expected missing-command lookup.

PowerShell✓ Tested
PowerShellDates & numeric validation

Clamp a number to inclusive bounds

PowerShell: Math.Clamp chooses the nearest endpoint for an out-of-range value.

PowerShell✓ Tested
PowerShellGetting Started

Combine conditions with and

PowerShell: Combine conditions with and using PowerShell 7.

PowerShell✓ Tested
PowerShellGetting Started

Compare a value with a limit

PowerShell: Compare a value with a limit using PowerShell 7.

PowerShell✓ Tested
PowerShellDates & numeric validation

Compute beyond the fixed-width integer range

PowerShell: BigInteger keeps an exact result when ordinary integer types are too small.

PowerShell✓ Tested
PowerShellHashtables & object records

Construct a record with named properties

PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.

PowerShell✓ Tested
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