Q:

Differences between two options to run a command

I tried to run the following command in two different ways:
get-service | where-object {$_.Status -eq 'Running'}

In the upper window I loaded the PowerShell and then the command
and in the lower both steps at once.
Generally the second option works fine,
what was the reason for the difference?
The same command in two different ways

A:

Put the command after powershell in quotes, then it will run

