FIND YOUR NEXT FEW LINES

Results for “CMD”

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

254 snippets foundClear filters
PowerShellArray operations

Reverse a copy while preserving the source

PowerShell: Clone the array before using Array.Reverse because Reverse mutates its argument.

PowerShell✓ Tested
SQL ServerTransactions & tables

Roll back a trial update

Group a change in a transaction and undo it.

transaction✓ Tested
PowerShellDates & numeric validation

Round a decimal with a chosen midpoint rule

PowerShell: Use decimal input and an explicit rounding policy for a reproducible decimal result.

PowerShell✓ Tested
PowerShellGetting Started

Run a first PowerShell statement

PowerShell: Run a first PowerShell statement using PowerShell 7.

PowerShell✓ Tested
SQL ServerGetting Started

Run a first SELECT query

SQL Server: Return a literal value without creating a table.

SQL Server✓ Tested
PowerShellFunctions & parameter validation

Run cleanup after a caught exception

PowerShell: Use finally for cleanup that must occur after either success or failure.

PowerShell✓ Tested
SQL ServerText cleanup & matching

Search for a literal LIKE wildcard

SQL Server: Declare an escape character so a percent sign in the pattern is literal.

SQL Server✓ Tested
PowerShellArray operations

Select elements by an index range

PowerShell: An index range selects the requested array positions in order.

PowerShell✓ Tested
PowerShellCollections & objects

Select object properties

Create a smaller object with only the fields you need.

Select-Object✓ Tested
PowerShellGetting Started

Select the first pipeline values

PowerShell: Select the first pipeline values using PowerShell 7.

PowerShell✓ Tested
SQL ServerSelect & page

Select the highest values with TOP

Limit an ordered SQL Server result.

TOP✓ Tested
SQL ServerWindow analytics

Select the top row in each group with a tie-breaker

SQL Server: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

SQL Server✓ Tested