Results for “New-Item”
Small, practical examples. Search by task or narrow things down below.
Process a first-in first-out queue
C++: Queue exposes its front item separately from the operation that removes it.
C++✓ Tested
Read a file size in bytes
PowerShell: The Length property of a file item reports its logical byte size.
PowerShell✓ Tested
Read a file without losing its last line
Handle spaces, backslashes, and a final line without a newline.
read lines✓ Tested
Read a JSON property
Parse a JSON document and dispose it after reading in C#.
C#✓ Tested
Read a text file
Load a small text file into a C# string.
C#✓ Tested
Read a whole text file
Load text as one string instead of one item per line.
Get-Content✓ Tested
Read null-delimited filenames into an array
Bash Scripts: A null delimiter preserves spaces and embedded newlines in filenames.
Bash Scripts✓ Tested
Read recent commit messages
View a compact history in newest-first order.
log✓ Tested
Refresh a cached data attribute deliberately
jQuery: After the first read, data caches a parsed value; removeData forces a new attribute read.
jQuery✓ Tested
Remove duplicate values
Use LINQ Distinct and OrderBy for a sorted C# result.
C#✓ Tested
Remove matching elements
Remove selected list items from the DOM with jQuery.
jQuery✓ Tested
Rename a file in its current directory
PowerShell: Rename-Item changes the name without moving the item to another directory.
PowerShell✓ Tested