Monday, January 19, 2009

beginning with an 'n'

[] to list out the service name (not the displayName) beginning with 'n'

PS> get-service -include n*

[] to list out the service (displayName) beginning with 'n'

PS> get-service -displayName n*

[] to display only the service names that begin with 'n'

1) gets the services (name, not DisplayName) on the system and then stores them in the $input1 variable

PS R:\> $input1 = get-service

2) gets the services in the $input1 variable, but includes only those that begin with 'n'

PS R:\> get-service -inputobject $input1 -include n*

'-InputOutput` parameter passes the objects stored in the variable to Get-Service.

No comments:

Post a Comment