Select-PropertyValue

Because PowerShell is all about the objects, I often point out to beginners to use the Select-Object cmdlet to see all the properties of an object and their values.

get-process powershell | select *

Using Get-Member is helpful to discover property names but sometimes you need to see a value to know which property or properties you really want to work with. That’s where my Select-Object suggestion comes in. Unfortunately not every property is defined for every object so you can end up with a lot of empty properties. What I wanted was a way to only display properties for an object that have a value. Here’s my solution.

Read More

March PowerShell Oneliner

In this month’s SAPIEN newsletter I offered a PowerShell oneliner to returns usage information for a specified folder. I don’t have room in the newsletter to go into detail so here is more in-depth coverage of this oneliner. I’ll also have a downlink link at the end.

Read More

Why does Select-Object take so long to keep the -first objects?

There’s recently been a big discussion on the PowerShell MVP mailing list about Select-Object and its -first parameter, which instructs it to only keep the first “x” objects it’s given. The discussion basically goes like this: 1..10000 | select -first 10 In this, a collection of objects numbering 1 to 10,000 is piped to Select-Object, […]

Read More

Search

Enter any query and press enter
Advanced search operators:
+ ⟶ Term must appear
- ⟶ Term must not appear
"" ⟶ Exact string must appear
How do I use these?

Join our mailing list

Enter your email address to subscribe to our mailing lists for Monthly Blog Digests, Product Announcements and more (you can choose which you receive once you sign-up!)

Tags

Categories

Archives

Dashboard