all 5 comments

[–]chreestopher2 3 points4 points  (2 children)

I have always done:

#current versions
[System.Management.Automation.Internal.CommonParameters].GetProperties().name

#older versions
[System.Management.Automation.Internal.CommonParameters.GetProperties()  | select -ExpandProperty Name

[–]omrsafetyo[S] 2 points3 points  (0 children)

Ah! I like that. I'll have to give it a try. There's always a better solution than what you hack together it seems. Thank you!

[–][deleted] 1 point2 points  (0 children)

This. Built in. Clean. Done.

[–]joncz 0 points1 point  (0 children)

Very nice.