when you post code, error messages, sample data or console output format it as code, please.
In the “Text” view you can use the code tags “PRE”, in the “Visual” view you can use the format template “Preformatted”. You can go back edit your post and fix the formatting - you don’t have to create a new one.
Thanks in advance.
Select-Object needs an InputObject. Either by pipeline or explicit. You do not provide any input object in your first code snippet. ;-} You may (re-)read the help for the cmdlet including the examples to learn how to use it.
BTW: The subject you choose does not fit your question at all in my opinion.