FIND YOUR NEXT FEW LINES

The snippet library.

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

25 snippets foundClear filters
PowerShellGetting Started

Assign a value to a variable

PowerShell: Assign a value to a variable using PowerShell 7.

PowerShell✓ Tested
PowerShellGetting Started

Calculate a simple total

PowerShell: Calculate a simple total using PowerShell 7.

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
PowerShellGetting Started

Count array elements

PowerShell: Count array elements using PowerShell 7.

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
PowerShellGetting Started

Filter pipeline values

PowerShell: Filter pipeline values using PowerShell 7.

PowerShell✓ Tested
PowerShellGetting Started

Handle an expected terminating error

PowerShell: Handle an expected terminating error using PowerShell 7.

PowerShell✓ Tested
PowerShellGetting Started

Insert a variable into a string

PowerShell: Insert a variable into a string using PowerShell 7.

PowerShell✓ Tested