This time the property "Computername" from the pipe is correctly submitted to "get-service". I'm wondering, cause the help for "get-service" is showing, that the "*" can be used for the parameter 'name'.
I'm not looking for another way to solve the problem – I would like to understand why the 'pipelining by parameter name' doesn't work as expected.
by Klaas at 2012-12-21 00:27:12
I'm not 100% sure, but I believe the input to Get-Service will first be bound to the -Name parameter if there isn't anything else assigned there. Probably the wildcard character doesn't fill in the needs, while the "audiosrv" does. In that case the input will be used for the -computername parameter. The ByValue method will be used first and ByPropertyName only when ByValue fails, and the -Name parameter has position 1. Don explains this a lot better than I can in 'Learn Powershell3 In a month of lunches', ch 9, p 99.