I am trying to get into PowerShell and ran into my first hurdle.
when i run
Get-Command | Where-Object CommandType -contains Cmdlet
My output is filtered so that only commands with the value of the CommandType property containing "Cmdlet" are displayed, for example:

You can do the same with the Source object:
Get-Command | Where-Object Source -contains appx
Which gets me:

But when I try to run:
Get-Command | Where-Object Name -contains Add
I get nothing. Why can I filter the output using the "CommandType" and "Source, but not the" Name "objects? Of course, I missed something here ...
Edit: I know I can run:
Get-Command -verb "get"
And get the desired result. But I'm trying to understand why my where-object statement does not work.
Edit 2:
Obviously, if I use the comparison operator "-match", it works ...
get-command | where-object Name -match "add"
But aren't the "name" properties just strings? -match should be used to compare afaik regular expressions? I'm so confused now ...
source share