(first of all, I have searched SO,internet,youtube, for half an hour and didn't came with proper answer so I ask here)
I'm coming from the realm of routers and helpesk when you can simply filter string\s from an output with
"| include" (cisco) or "| findstr" (windows) like this:
I found out, on powershell we use 'Select-String' with the 'Pattern' switch.
For instance, i want to print out all the lines which contain the word 'Suffix' but it doesn't seem to work. What is the correct way, and can I use it without the need to creat a variable.
Select-String is a cmdlet to find text in strings and files.
Get-NetIPAddress does not output a string, but an array of (CimInstance) objects.
To select only certain values from this array, you can pipe the result through to
Select-Object
like for instancewhich outputs something like:
This output on its own is probably not very usefull though..
You might want to end up with selecting a few more properties like with