Results for “Where-Object”
Small, practical examples. Search by task or narrow things down below.
Write object records to a CSV file
PowerShell: Export-Csv uses property names as headers and quotes values when needed.
PowerShell✓ Tested
Add a calculated property during selection
PowerShell: A calculated property can derive a value while retaining selected original properties.
PowerShell✓ Tested
Align an image within its content box
CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.
CSS✓ Tested
Check for a hashtable key before reading it
PowerShell: ContainsKey distinguishes a missing key from a key whose value happens to be null.
PowerShell✓ Tested
Construct a record with named properties
PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.
PowerShell✓ Tested
Copy nested structured data independently
JavaScript: structuredClone creates an independent copy of supported structured values.
JavaScript✓ Tested
Copy nested structured data independently
TypeScript: structuredClone creates an independent copy of supported structured values.
TypeScript✓ Tested
Count items by group
Group repeated values and report each count.
Group-Object✓ Tested
Delete one matching row
Remove a selected record and inspect what remains.
DELETE✓ Tested
Distinguish an own property from an inherited one
JavaScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
JavaScript✓ Tested
Distinguish an own property from an inherited one
TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
TypeScript✓ Tested
Enumerate hashtable entries in a stable order
PowerShell: Sort entries by key when predictable output matters.
PowerShell✓ Tested