FIND YOUR NEXT FEW LINES

Results for “New-Item”

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

210 snippets foundClear filters
PowerShellFiles & paths

Create a directory if needed

Ensure a directory exists before writing output.

New-Item✓ Tested
PowerShellArray operations

Append an item to a small array

PowerShell: The plus-equals operator builds a new array; use a generic list for repeated large additions.

PowerShell✓ Tested
PythonMappings & sets

Keep only the most recent items

Python: Use a bounded deque to discard the oldest item as new values arrive.

Python✓ Tested
Bash ScriptsArray operations

Prepend items while preserving existing array values

Bash Scripts: Construct a new array with the new values before the quoted original expansion.

Bash Scripts✓ Tested
C#LINQ transformations

Transform each item with Select

C#: Project each input value into a new value without modifying the source array.

C#✓ Tested
CSSFlexbox alignment

Align flex items at the main-axis end

CSS: Flex-end uses the trailing edge of the flex container for packing.

CSS✓ Tested
jQueryDOM & classes

Append a list item

Build a jQuery element with text and append it safely.

jQuery✓ Tested
Linux CommandsArchive integrity & packaging

Append a new member to an uncompressed tar

Linux Commands: Use tar -r for an existing uncompressed archive; compressed tar files cannot be appended this way.

Linux Commands✓ Tested
jQueryGetting Started

Append a safely constructed list item

jQuery: Learn how to append a safely constructed list item in a complete browser example.

jQuery✓ Tested
Bash ScriptsArray operations

Append several items to an array

Bash Scripts: Array-plus-equals adds elements without losing spaces inside a quoted item.

Bash Scripts✓ Tested
CSSGrid placement

Center a small item in a grid cell

CSS: Place-items sets both block-axis and inline-axis item alignment.

CSS✓ Tested
JavaScriptArray traversal & selection

Check whether any item matches

JavaScript: some stops once a predicate succeeds.

JavaScript✓ Tested