-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

PowerShell 7 Workshop
By :

Many of the cmdlets we might run will produce a large amount of output, and, likely, much of it will not be interesting. Therefore, it’s useful to be able to select just the bits we need and sort them into a meaningful order. There are two cmdlets for doing this: Select-Object
and Sort-Object
. We will often see these referred to by their aliases – select
and sort
.
We used Select-Object
in the What is an object? section to select the unique properties of objects in a collection. However, we can use it to do so much more. Look at the help file for Select-Object
by running the following command:
Get-Help Select-Object
Here, we can see that there are four parameter sets, all of which work in one of two ways – we can either use the cmdlet to work with one or more properties of a collection, or we can use it to select a subset of objects in a collection. Let’s try the first one by typing the following...
Change the font size
Change margin width
Change background colour