---
title: "PowerShell Select-Object Made Simple: A Beginner’s Guide"
description: "Learn the basics of PowerShell Select-Object with this beginner’s guide. Simplify your commands and streamline your workflow with ease."
canonical: "https://adamtheautomator.com/powershell-select-object/"
---

# PowerShell Select-Object Made Simple: A Beginner’s Guide

> Learn the basics of PowerShell Select-Object with this beginner’s guide. Simplify your commands and streamline your workflow with ease.

Source: https://adamtheautomator.com/powershell-select-object/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![PowerShell Select-Object Made Simple: A Beginner’s Guide](https://adamtheautomator.com/wp-content/uploads/2023/03/powershell-select-object.jpg)

# PowerShell Select-Object Made Simple: A Beginner’s Guide

[![](https://secure.gravatar.com/avatar/2788bb1a3f735603f81eca51d68daec56a9d97e805a10268fb2c20afcc76b81b?s=192&d=mm&r=g)Nicholas Xuan Nguyen](https://adamtheautomator.com/author/nicholas-xuan-nguyen/)20 March 20235 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [What is PowerShell Select-Object cmdlet?](#what-is-powershell-select-object-cmdlet)
*   [Selecting Objects by Properties](#selecting-objects-by-properties)
*   [Creating a Calculated Property](#creating-a-calculated-property)
*   [Excluding a Specified Property](#excluding-a-specified-property)
*   [Skipping the First or Last Number of Objects](#skipping-the-first-or-last-number-of-objects)
*   [Selecting the First or Last Number of Objects](#selecting-the-first-or-last-number-of-objects)
*   [Selecting Unique Objects Exclusively](#selecting-unique-objects-exclusively)
*   [Conclusion](#conclusion)

PowerShell is a powerful tool for managing data, but also typically provides too much information at once. As you know, too much information can be overwhelming and difficult to parse through. Not to worry, though. The [PowerShell `Select-Object`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-object?view=powershell-7.3) cmdlet will come in handy.

In this tutorial, you will learn the basics of the `Select-Object` cmdlet to narrow down or filter results in many ways.

Read on and start painless data management!

## Prerequisites

This tutorial comprises hands-on demonstrations. To follow along, be sure you have a system with PowerShell installed. This tutorial uses Windows 10 with [PowerShell 7](https://adamtheautomator.com/powershell-7-upgrade/), but any modern version should also work.

Related:[PowerShell 7 Upgrade : A How to Walk Through](https://adamtheautomator.com/powershell-7-upgrade/)

## What is PowerShell Select-Object cmdlet?

The `Select-Object` cmdlet simplifies data management by allowing you to select specific properties from an object or dataset. At the same time, you can rename properties or create calculated properties based on existing ones.

Related:[Back to Basics: Understanding PowerShell Objects](https://adamtheautomator.com/powershell-objects/)

The basic syntax of `Select-Object` is as follows where:

| Parameter | Function |
| --- | --- |
| `-InputObject` | Specifies the object or data set you want to work with, which can be an object, an [array of objects](https://adamtheautomator.com/powershell-array/), or an output of another cmdlet. |
| `Property` | Specifies the property or properties to select from the `InputObject` parameter. You can specify multiple properties separated by commas. |
| `Optional Parameters` | Allows you to refine your selection, such as selecting a certain number of objects or skipping objects. |

```powershell
Select-Object [-InputObject] [Property] [Optional Parameters]
```

## Selecting Objects by Properties

Since more than a short introduction is needed to satisfy your desire to learn about the `Select-Object` cmdlet, why not start with one of its common use cases? Kick off this tutorial by selecting a specific property from an object with the `Select-Object` cmdlet.

Suppose you have a list of processes running on your computer, but you only wish to see the names of each process. Specifying the `Name` property to the `Select-Object` cmdlet will do the trick.

Open PowerShell and run the below [`Get-Process`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process) command to retrieve and print a list of all processes only (`Select-Object`) by `Name`.

```powershell
Get-Process | Select-Object Name
```

Related:[Steamy PowerShell Get-Process Cmdlet for Running Processes](https://adamtheautomator.com/powershell-get-process/)

![Selecting objects by property](https://adamtheautomator.com/wp-content/uploads/2023/03/image-167.png)

Selecting objects by property

> _Besides running processes, the `Select-Object` cmdlet lets you work on a CSV file. Suppose you have a CSV file with many columns but only need a few of them. In that case, let the `Select-Object` cmdlet choose only the relevant columns so you can manipulate and analyze the data._

Now, run the following command to select multiple properties (`Select-Object`): `Name` and `CPU` (separated by commas). This feature helps when working with large data sets where you only need some properties of each object.

In addition, this command also sorts the list of objects (`Sort-Object`) in `-Descending` order with the `CPU` property as the reference.

```powershell
Get-Process | Select-Object Name, CPU | Sort-Object -Descending CPU
```

Below, you can see the processes listed, starting from the most resource-consuming one, Google Chrome (if you have one installed).

Related:[How to Install Google Chrome for Ubuntu](https://adamtheautomator.com/install-google-chrome-for-ubuntu/)

![Selecting multiple properties](https://adamtheautomator.com/wp-content/uploads/2023/03/image-168.png)

Selecting multiple properties

## Creating a Calculated Property

When looking for properties that better fit your needs, consider creating a calculated property. Why? Calculated properties allow you to manipulate and transform data, combine existing properties, perform mathematical operations, or format data in a specific way.

To create a calculated property, you must specify a new property name and an expression that defines how to calculate the property value:

Run the command below to perform the following:

*   Retrieve a list of running processes (`Get-Process`), selecting only (`Select-Object`) the `Name` and `CPU` properties.
*   Create a new calculated property with the `Name` `Memory (MB)`, which calculates the memory usage of each process in megabytes. The memory usage is calculated using an `Expression` that divides the `WorkingSet` property by `1MB`. Any valid PowerShell expression works in creating a calculated property.
*   Prints all retrieved running processes in `-Descending` order by the calculated `Memory (MB)` property.

```powershell
Get-Process | Select-Object Name, CPU, @{Name="Memory (MB)";Expression={$_.WorkingSet/1MB}} | Sort-Object -Descending "Memory (MB)"
```

![Creating a calculated property](https://adamtheautomator.com/wp-content/uploads/2023/03/image-169.png)

Creating a calculated property

## Excluding a Specified Property

In real life, the results of a `Select-Object` command may contain sensitive information, such as usernames and passwords. How to avoid this risk?

To prevent sensitive data from being displayed in the output, append the `-ExcludeProperty` parameter to exclude a specified property from the output.

Run the following command to perform the following tasks:

*   Retrieve a list of all the files and folders ([`Get-ChildItem`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem)) in the `C:\\` directory recursively (`-Recurse`).

Related:[Get-ChildItem: Listing Files, Registry and Certificates](https://adamtheautomator.com/get-childitem/)

*   Pipe the output to the `Select-Object` cmdlet to select the `Name`, `Length`, and `LastWriteTime` properties.
*   Exclude (`-ExcludeProperty`) the `FullName` property from the output. Doing so prevents the full paths from being displayed in the output, which may contain confidential information.

```powershell
Get-ChildItem -Path C:\ -Recurse | Select-Object Name, Length, LastWriteTime -ExcludeProperty FullName
```

![Excluding a specified property](https://adamtheautomator.com/wp-content/uploads/2023/03/image-170.png)

Excluding a specified property

## Skipping the First or Last Number of Objects

When working with massive datasets, finding the data you need can be like searching for a diamond in a coal mine. But why waste time sifting through irrelevant data?

In PowerShell, the `Select-Object` cmdlet provides two parameters that let you exclude the first (`-Skip`) and last (`-SkipLast`) number of objects in the output, respectively.

To see how skipping several objects from an output works:

Run the below command to get all running processes (`Get-Process`) but `-Skip` the first `100` objects returned.

> _Note that the number of objects skipped is based on integer values (positive and whole numbers without decimal points), which in this case is `100`._

```powershell
Get-Process | Select-Object -Skip 100
```

![Skipping the first 100 objects](https://adamtheautomator.com/wp-content/uploads/2023/03/image-171.png)

Skipping the first 100 objects

Now, run the following command to get a list of the working directory’s contents (`Get-ChildItem`) but skip the last (`-SkipLast`) `100` objects returned.

```powershell
Get-ChildItem | Select-Object -SkipLast 100
```

![Skipping the last 100 objects](https://adamtheautomator.com/wp-content/uploads/2023/03/image-172.png)

Skipping the last 100 objects

## Selecting the First or Last Number of Objects

Besides skipping the first and last number of objects, you may also be interested in selecting the first and last number of objects instead. The `Select-Object` cmdlet supports this feat with the `First` and `Last` parameters that let you skip everything else to save time and resources.

Run the following command to get all processes but only select (`Select-Object`) the `-First 10` objects returned.

```powershell
Get-Process | Select-Object -First 10
```

![Selecting the first 10 objects returned](https://adamtheautomator.com/wp-content/uploads/2023/03/image-173.png)

Selecting the first 10 objects returned

Now, run the command below to get all contents of the working directory (`Get-ChildItem`) but only select (`Select-Object`) the `-Last 10` objects returned.

```powershell
Get-ChildItem | Select-Object -Last 10
```

![Selecting the last 10 objects returned](https://adamtheautomator.com/wp-content/uploads/2023/03/image-174.png)

Selecting the last 10 objects returned

## Selecting Unique Objects Exclusively

As you work with larger datasets, you will encounter duplicate values you may want to exclude from the output, which is typical. But the good thing with the `Select-Object` cmdlet is that you do not have to exclude duplicate values manually.

Appending the `-Unique` parameter allows you to select only the unique objects from the output, streamlining your analysis and improving your results’ accuracy.

Run the command below to select (`Select-Object`), and return the `-First 2` objects.

```powershell
"1","1","2","3" | Select-Object -First 2
```

Below, you can see two returned objects regardless if the other is a duplicate value.

![Selecting and returning objects with duplicate values](https://adamtheautomator.com/wp-content/uploads/2023/03/image-175.png)

Selecting and returning objects with duplicate values

Lastly, run the following command to return only one `-Unique` value for each of the `-First 2` objects selected.

```powershell
"1","1","2","3" | Select-Object -First 2 -Unique
```

This time, you can see only one returned from the first two objects selected since the other is just a duplicate value. As you realize, this output proves that the `-Unique` parameter is handy for quickly discarding any duplicate objects in your data.

![Selecting unique objects exclusively](https://adamtheautomator.com/wp-content/uploads/2023/03/image-176.png)

Selecting unique objects exclusively

## Conclusion

PowerShell tends to produce an overload of information. But in this tutorial, you learned how the PowerShell `Select-Object` cmdlet helps streamline your data to see only the needed information.

You have seen how different parameters allow you to select and exclude data, especially duplicated values from an output. With the `Select-Object` cmdlet, managing large amounts of data does not have to be a daunting task.

At this point, you can quickly refine your results to be better suited for analysis and troubleshooting. But why not learn how to [format your calculated properties](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_calculated_properties?view=powershell-7.3#format-custom) next to improve readability and usability?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-select-object%2F&text=PowerShell%20Select-Object%20Made%20Simple%3A%20A%20Beginner%E2%80%99s%20Guide)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-select-object%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-select-object%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/publisher/3ec5d9c85b2b81d9ab7cd5dbb6caf044/21b786d67f19d1813150edf9871e36ead78714b63880de8c6161c7fde11a9769.webp)

### [Pktmon: Capture Windows Traffic Without a Third-Party Driver](/pktmon-capture-windows-traffic/)

Use the in-box Windows Pktmon tool to capture packets and packet-drop reasons, then convert the ETL to pcapng and text for offline analysis.

![](https://adamtheautomator.com/wp-content/uploads/publisher/2e05d9c85b2b81feb24af1f04a889143/3eab14af9dabf46fbd333914ce6ccf46f84117d2394d3e7218c186cd249bb7e2.webp)

### [PowerShell or Power Automate: Stop Automation Mistakes](/powershell-vs-power-automate/)

Score six factors to choose between PowerShell and Power Automate: target system, complexity, data volume, team skills, cost, governance.

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
