Exercise 2: -Property vs. -ExpandProperty — Possible Solution ==================================================================== THE DIFFERENCE ------------------------------ Select-Object -Property ProcessName returns a trimmed-down object that still has a ProcessName property attached to it - it is still an object, just with fewer properties than the original. Select-Object -ExpandProperty ProcessName returns the raw string value itself, with the object wrapper removed entirely - the result is a plain string, not an object with a ProcessName property. A CONCRETE SITUATION WHERE USING THE WRONG ONE CAUSES A PROBLEM ------------------------------ Per this chapter's own warning, comparing a -Property result directly against a string with -eq will never match, because you'd be comparing a whole object (which still has a ProcessName property, an Id property, and so on) against a bare string like "chrome" - the comparison fails even if the process name really is "chrome," because the two sides are different types. Using -ExpandProperty ProcessName instead returns the plain string "chrome" itself, which -eq "chrome" can actually match correctly. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that -Property keeps an object wrapper while -ExpandProperty strips it down to a raw value, and gives a concrete, chapter-grounded example (an -eq string comparison silently failing) where picking the wrong one causes a real, non-obvious problem.