What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To create a simple PowerShell record with named properties, cast a hashtable literal to [pscustomobject]:
$person = [pscustomobject]@{
Name = 'Ada'
Role = 'Engineer'
Active = $true
}
$person.Name
$person | Get-Member
Use this pattern for an ad hoc object you can access with dot notation and pass through the pipeline. If you need a dictionary whose keys stay in insertion order, use [ordered]@{} instead; if you need a reusable named type, consider a class. The exact behavior of version-sensitive details depends on the PowerShell runtime you use.
How to create a PowerShell object with properties
A hashtable literal supplies the property names and values; the direct cast turns it into a custom object. Read a property with dot notation, and inspect the object’s members with Get-Member.
$person = [pscustomobject]@{
Name = 'Ada'
Role = 'Engineer'
Active = $true
}
$person.Name
$person | Get-Member
This is Microsoft’s documented simple pattern for creating a custom object. Microsoft Learn: about_PSCustomObject
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
How to create a collection of custom objects
Put one custom object per item in an array. Each pipeline item then has its own properties, which downstream commands can select or process:
$people = @(
[pscustomobject]@{ Name = 'Ada'; Role = 'Engineer' }
[pscustomobject]@{ Name = 'Grace'; Role = 'Mathematician' }
)
$people | Select-Object Name, Role
Select-Object here projects the requested properties for output; it does not change the purpose of the original objects.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Choose the structure that matches the job
| Choice | Best for | Access and ordering |
|---|---|---|
[pscustomobject]@{} |
A one-off record with named properties | Use property access such as $person.Name. A direct cast of a hashtable literal preserves its literal order. |
[ordered]@{} |
A key-value dictionary where insertion order matters | Access dictionary keys; keys remain in insertion order. |
Add-Member or Select-Object |
Adding members to, or projecting properties from, existing data | Useful for shaping objects created elsewhere rather than declaring the simplest new record. |
| A class | A reusable named type, potentially with type-defined behavior | Defines a type for cases where a one-off custom object is not enough. |
Microsoft’s object-creation overview also describes creating objects from sources such as CSV or JSON, as well as approaches including Add-Type, New-Module, and .NET object construction. These are alternatives for particular needs, not requirements for every custom record. Microsoft Learn: about_Object_Creation
When to use an ordered hashtable
A hashtable is a key-value dictionary. To make an ordered dictionary, use the [ordered] accelerator:
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
$settings = [ordered]@{
First = 1
Second = 2
}
The resulting OrderedDictionary keeps keys in insertion order. This is a dictionary, not the same choice as a custom object when you want to work primarily with object properties. Microsoft documents [ordered] in its about_Hash_Tables reference.
Preserve property order when converting to a custom object
PowerShell objects keep members in the order they were added. If the output member order matters, cast the hashtable literal directly, as in [pscustomobject]@{ First = 1; Second = 2 }. Do not assume the same order when converting a normal hashtable stored in a variable, or a parenthesized hashtable; that conversion does not guarantee the literal’s order. See Microsoft’s about_PSCustomObject documentation.
Rank #4
- 【Versatile Storage Expansion – For Gaming, Work & Everyday Use】 Running out of space on your PS5 or Xbox Series X/S? This external hard drive lets you store and play PS4 / Xbox One games directly, instantly freeing up your console’s internal storage for next‑gen titles. At the same time, it handles work file backups, media libraries, and cross‑device data transfers with ease. One drive, all your needs. *(Note: PS5 / Xbox Series X|S games cannot be run or stored directly from the external hard drive. However, by offloading your PS4 / Xbox One games, you can free up valuable space for newer titles.)*
- 【Patented Silicone Sleeve – Data Protection You Can Count On】 Worried about drops? We’ve got you covered. The patented built‑in silicone sleeve acts like a shock‑absorbing armor, cushioning your drive against bumps and falls. Whether it’s important work documents, precious family photos, or hard‑earned game saves, your data deserves this level of protection.
- 【Plug & Play, Compatible with Computers & Consoles】 No complicated setup—just plug in and go. Works seamlessly with Windows, Mac, and Linux computers, as well as PS4, PS5, Xbox One, and Xbox Series X/S. Process files at the office, back up data at home, or enjoy gaming in your downtime—one drive handles all your devices, simply and hassle‑free.
- 【USB 3.0 Ultra‑Fast Transfer – No More Waiting】 Tired of watching progress bars crawl? With USB 3.0 speeds up to 5Gbps, large files transfer in seconds. Whether you’re moving work documents, transferring hundreds of gigs of games, or backing up a year’s worth of photos, you get more done in less time.
- 【Sleek, Lightweight, and Ready to Go】 Weighing just 0.16 kg—lighter than a can of soda—this compact drive features a stylish mirror‑and‑frosted finish. Toss it in your bag and go, whether you’re heading to the office, visiting a friend for a gaming session, or giving a presentation on the road.
When to shape an existing object instead
Use Add-Member when you need to attach a member to an object you already have. Use Select-Object to select properties or create calculated output properties. These tools are suited to adapting existing data; for a new ad hoc record, the direct [pscustomobject] literal is simpler. Microsoft Learn: about_Object_Creation
When a class is the better fit
Use a class when your task calls for a reusable, named type definition and possibly behavior defined by that type. A class is more structure than a one-off record needs. Microsoft lists class definitions among PowerShell’s object-creation methods in its object-creation overview.
Best Value
- High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
- Plug-and-play expandability
- Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
- SuperSpeed USB 3.2 Gen 1 (5Gbps)
PowerShell version details to know
- Microsoft documents
[pscustomobject]and[ordered]as available since PowerShell 3.0. Older runtimes may therefore require a different approach. - The documented
CountandLengthbehavior for a hashtable cast to[pscustomobject]differs by runtime: in Windows PowerShell, accessing those members returns$null; PowerShell 6 and later report1. - Do not use an individual record’s
CountorLengthas a way to count records. For a collection, count the collection itself and verify behavior in the target runtime.
For the compatibility details, see about_PSCustomObject and about_Hash_Tables.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




