FIND YOUR NEXT FEW LINES

Results for “power”

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

128 snippets foundClear filters
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
PowerShellGetting Started

Create a portable relative path

PowerShell: Create a portable relative path using PowerShell 7.

PowerShell✓ 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
PowerShellFile operations & integrity

Delete only a named scratch file

PowerShell: Use LiteralPath and avoid recursive removal for a single known file.

PowerShell✓ Tested
PowerShellCommands & execution context

Discard incidental output from a setup command

PowerShell: Out-Null prevents setup objects from becoming part of a function or script’s useful result.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Dispatch values with wildcard patterns

PowerShell: Switch -Wildcard interprets shell-style matching patterns for each clause.

PowerShell✓ Tested