Results for “New-Item”
Small, practical examples. Search by task or narrow things down below.
Split and trim values
Split simple comma-separated C# text and trim each value.
C#✓ Tested
Stop a search loop at the first match
Bash Scripts: Break exits the current loop as soon as the desired item is found.
Bash Scripts✓ Tested
Sum integer values
Sum a C# sequence using LINQ.
C#✓ Tested
Supply an environment variable to an exec process
Docker / Compose: An exec environment override applies to the new process only.
Docker / Compose✓ Tested
Test whether an array contains a value
PowerShell: The contains operator compares complete items rather than matching substrings.
PowerShell✓ Tested
Transform a deferred value with then
jQuery: then returns a new promise with the callback’s result.
jQuery✓ Tested
Trim surrounding whitespace
Remove whitespace at the ends of a C# string.
C#✓ Tested
Try parsing an integer
Use TryParse to avoid exceptions for invalid C# integer input.
C#✓ Tested
Turn JSON into typed rows
Project JSON array items into SQL columns.
OPENJSON✓ Tested
Update a JSON property
Create updated JSON text with JSON_MODIFY.
JSON_MODIFY✓ Tested
Update several classifications in one statement
SQL: A CASE expression computes the new value for each row covered by the update predicate.
SQL✓ Tested
Update several classifications in one statement
SQL Server: A CASE expression computes the new value for each row covered by the update predicate.
SQL Server✓ Tested