powershell script error

https://www.reddit.com/r/PowerShell/comments/l9b9nd/powershell_script_execution_error/?

I run this powershell script in windows 2019

https://pastebin.com/JURmxZeH

I get this Error:

< : The term ‘<’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Full Error https://i.imgur.com/jEwWhfA.png

What is the issue ? Is there any way to fix this error ?

Source of this powershell script is https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-ec2.html (Example User data script - Windows server)

You should not be running scripts unless you full understand what they do. If you don’t understand what the issue is with the script, then you definently should not be running this script. This script is downloading a ZIP from the web, extracting it and creating a service which is how malware, ransomware and generally dangerous code is placed on systems. Do not run this!

[quote quote=289591]You should not be running scripts unless you full understand what they do. If you don’t understand what the issue is with the script, then you definently should not be running this script. This script is downloading a ZIP from the web, extracting it and creating a service which is how malware, ransomware and generally dangerous code is placed on systems. Do not run this!

[/quote]
I want to run this. Do you spot the error and suggest how to fix this ?

This is from AWS Documentation. It is not malware , ransomeware etc.

 

Hi,
Just remove those 2 XML tags from line 1 and 29. It’s not a syntax for a simple PowerShell script.
+1 for @Rob, be sure to understand what you are doing with online scripts, adapt it for your own case. Some online script are just template and must be customized by your own business.