So now that we understand execution policies,
let's understand how that flows into PowerShell scopes.
Now, firstly, we need to understand what a PowerShell scope actually is.
So execution policies can be set, remember,
at the current user level or the local machine level,
which, then on a Windows machine, will store those values within a registry.
Now we do have another option that's available to us for execution policies,
but in order to understand that, we need to know what those three scopes are.
So our first scope that we haven't talked about yet is the Process.
So we can actually assign an execution policy to a specific process,
such as the PowerShell session that we have launching at the time.
We then also have the CurrentUser one, which will only affect the
specific user who happens to be logged in at that point.
So if I'm logged into the Windows machine,
then it executes, you know, and the policy is assigned to me.
Then there's the LocalMachine scope,
which means that whatever the policy is assigned,
it will affect every single user on that machine.
Now we can utilize Group Policy to kind of associate and
assign these policies. Now, first off,
we have a machine policy, so we can set that by the Group Policy,
and it will affect all of the users on the computer, so
machine policy can be associated.
We can also assign a user policy,
which will be a Group Policy to affect the current user on the computer.
Now notice we're not able to create a process policy because the process
is done at the launching of the specific application.
So in this instance, it'll be PowerShell.
So there's no way for us to define a Group Policy that says every
time you do X, use this session type policy. So it's important to
understand the differences, three types of scopes and then multiple policies that we can associate.