Results for “Get-Content”
Small, practical examples. Search by task or narrow things down below.
Read the final array item with a negative index
TypeScript: at supports negative positions counted from the end.
TypeScript✓ Tested
Recover from an expected promise rejection
TypeScript: Return a fallback from catch so later handlers receive an ordinary resolved value.
TypeScript✓ Tested
Refuse to overwrite an existing file with redirection
Bash Scripts: Noclobber makes a plain greater-than redirection fail when the target already exists.
Bash Scripts✓ Tested
Reject an integer with trailing characters
Arduino / C: strtol exposes an end pointer so a parser can require the entire token.
Arduino / C✓ Tested
Reject an unsupported settings version
Arduino / C: A version byte lets firmware fall back when stored settings use another format.
Arduino / C✓ Tested
Reject insertion when a fixed queue is full
Arduino / C: Track a count separately from circular read and write positions.
Arduino / C✓ Tested
Reject one outlier with a median-of-three filter
Arduino / C: Sorting three values leaves the median in the middle.
Arduino / C✓ Tested
Remove a hidden element’s layout space
CSS: Display none removes a box from layout as well as hiding its contents.
CSS✓ Tested
Remove a Map entry and detect whether it existed
TypeScript: Map.delete returns true only when an entry was present.
TypeScript✓ Tested
Remove a wrapper while preserving its children
jQuery: unwrap replaces a selected element’s parent with that parent’s contents.
jQuery✓ Tested
Remove blank or whitespace-only lines
Linux Commands: Use a POSIX character class so tabs and spaces are handled together.
Linux Commands✓ Tested
Remove duplicate values with a Set
Keep the first occurrence order while deduplicating.
Set✓ Tested