PowerShell internally always works with objects, and this can cause confusion when you mix object and string technologies.
In a previous example, you learned how to retrieve all font families like this:
$families = (New-Object System.Drawing.Text.InstalledFontCollection).Families
If you tried to filter out only font families that match "Wingdings", you might have tried Select-Object like this:
The result isn't what you expected , though. As it turns out, $families does not contain a collection of plain text strings but objects instead:
System.Drawing.FontFamily
You would first have to explicitly convert the objects into plain text strings to then process them with Select-String. There is a way to do that: pipe objects through Out-String -stream, and they become text:
You could also take a closer look at the objects and then determine yourself which property you would like to pass on in the pipeline.
As it turns out, FontFamily objects only have one property called Name which is a string. So you could have also used this line:
Now, it may occur to you that you could search for specific font families in yet another way:
ForEach-Object { $_.Name }