All right,
let's break this down. And this is the process that I recommend that you follow.
Don't try to write the final PowerShell command,
especially when you're still learning PowerShell.
It will most likely fail, and then you'll struggle
to figure out what you did wrong.
Follow this approach that I'm about to show you.
So here's the example.
I want to get the bits and spooler services.
This command is going to write two service objects to the pipeline.
That vertical bar is the pipe symbol that tells PowerShell to
pass objects or send objects from one command on the left side,
in this case, Get‑Service, to something else that's going to
come up on the right side.
So with this, the objects are going to be passed to Set‑Service.
I want to do something with the objects.
In this case, I want to set the startuptype to manual.
You'll still need to have an understanding of the underlying technology.
I mean, if you have no idea what a service is in Windows,
you're going to have a hard time managing it with PowerShell.
And of course, for all these commands that you're looking at,
you need to make sure you read the help and example so that you can learn how to
set, in this case, services, and how they're going to work.
You can repeat this process until you are finished with your task.
If there are no other commands, then the PowerShell pipeline finishes,
and if there's any results, they'll be written to the pipeline.
Now, in this example,
Set‑Service doesn't write anything to the pipeline, so I get a new prompt.
I get no results.
What parameter do you think Set‑Service has if I wanted to see the results? Of course, ‑pass through.