The command [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User") is not a Python command. Instead, this is an operating system command to the set the PATH variable.
You are getting this error as you are inside the Python interpreter which was triggered by the command python
you have entered in the terminal (Windows PowerShell).
Please note the >>>
at the left side of the line. It states that you are on inside Python interpreter.
Please enter quit() to exit the Python interpreter and then type the command. It should work!